Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Adding a second manufacturer


Recommended Posts

If I add a second manufacturer (manufacturers2_id) to the products table, how would I get the second manufacturer to display in index.php?



I sell coffee and want to sort it by region but the coffee in blends is usually from more than one region so I want it to display on both the lists.

Link to comment
Share on other sites

The question is, how would you add a second manufacturer to a product?

The products table takes the manufacturer as manufacturer_id, so you would have to create a third manufacturer that would represent both.

Such as if one product was - 'product' and had two manufacturers - 'man1' and 'man2' then create a new maufacturer as 'man1-man2'. Associate this created manufacturer with the product on the products attribute page then do a str_search() '-' on the returned manufacterer name. Separate the two, then another db query would return the manufacturer_id for each..


Or manually create an array that would associate the products with different manufacterers:

array('product_id' => 'manufacterer_id', 'manufacterer_id'));


Either way you would have to edit the index file to display in html..


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...