Add manufacturers to invoice

Tagged: 

ThemeBurn SupportForumsOpenCart ThemesShoppica OpenCart ThemeAdd manufacturers to invoice

This topic has been marked as not a support question.

Hi,

I sell copyrighted artworks and I would like to add the manufacturer’s name to the invoice.
I will also add a line stating that all rights to reproduction remain with the artist.

To start with the easy stuff, I have replaced the ‘model’ table column header in ‘admin/view/template/sale/order_invoice.tpl’ with ‘artist’.

Now the model result field has to be replaced with a manufacturer result field.
So far I have replaced <td><?php echo $product['model']; ?></td> with <td><?php foreach ($manufacturers as $manufacturer) { ?><?php echo $manufacturer['name']; ?><?php } ?></td>.

In admin/controller/sale/order.php I have added the following code above $product_data = array();:

$this->load->model('catalog/manufacturer');
      $this->data['manufacturers'] = array();
        $manufacturers = $this->model_catalog_manufacturer->getManufacturers ($order_id);
        foreach ($manufacturers as $manufacturer) {
            $this->data['manufacturers'][] = array(
      'name'            => $manufacturer['name']);
        }

The invoice now displays a manufacturer, but it’s always the first manufacturer from the manufacturer’s list. I think the problem is there is no connection between order id and manufacturer id. So I can ask the database to find the manufacturers connected to this order, but it doesn’t know which those are.
I’ve noticed that order id and manufacturer id don’t share a database table, like for example order id and product id do. And it seems that they are not linked in one of the php files either.

Do you guys know of a way to make this connection?
Manufacturer id and product id are both in the product table and product id and order id in the order_product table. Maybe we can work with that?

I realize this is not purely a Shoppica question, but it would be great if you could provide any kind of help.

December 7, 2012 at 9:36 pm #15788

I might be able to solve this by using the model field for artist names.
Found some topics about adding manufacturers to pages using the model field, for anyone that’s interested:
http://forum.opencart.com/viewtopic.php?t=48011
http://forum.opencart.com/viewtopic.php?t=34739

December 7, 2012 at 10:25 pm #15789

Thanks for the shared information!

Best,
ThemeBurn team

December 11, 2012 at 10:36 am #15855
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.