Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display product manufacturer in Shopping cart?


al3ks

Recommended Posts

I am trying to display the name of the manufacturer for the each product in shopping cart, I have done it in product_info but here I can't seem to figure out how to do it.

 

Would appreciate any help

 

Thanks

Regards

Aleksander

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

Add manufacturer_name at around line number 76-77 of shopping_cart.php.

Like post..hit LIKE button.

 

osCommerce | Joomla | WordPress | Magento | SEO | CakePHP | CI

 

Guaranteed Website Speed Optimization!!

Link to comment
Share on other sites

Manufacturers name is not present in the $cart->get_products() that is used in file shopping_cart.php

 

So, you have 2 options

 

1) Query for the manufacturers name separately in file catalog/shopping_cart.php

 

You need to do this within the loop (start: for ($i=0, $n=sizeof($products); $i<$n; $i++) { ) similar to how it is done to get the attributes for each product I would not do this

 

2) Add the manufacturers name to the $products_array that is build in catalog/includes/classes/shopping_cart.php

 

To do this, you need to query for the name by adding to the existing query of function get_products() and then add the manufacturers name to the products_array

 

You will have the name then available in file catalog/shopping_cart.php in the same way you have eg the products name

Link to comment
Share on other sites

 

2) Add the manufacturers name to the $products_array that is build in catalog/includes/classes/shopping_cart.php

 

To do this, you need to query for the name by adding to the existing query of function get_products() and then add the manufacturers name to the products_array

 

You will have the name then available in file catalog/shopping_cart.php in the same way you have eg the products name

 

Thanks for the reply.

 

I'm trying to do the second option, but I'm stuck.

 

This is what I have right now, which I know doesn't work but don't know where things need to be changed:

 

<?php
   $any_out_of_stock = 0;
   $products = $cart->get_products();
$products_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . $products['manufacturers_id'] . "'");
$manufacturer_name = tep_db_fetch_array($products);

   for ($i=0, $n=sizeof($products); $i<$n; $i++) {

 

Could you help me get this right, please?

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

What you are trying to do right now is option#1: You add a query to file catalog/shopping_cart.php.

 

In the case you need to put the query within the loop, that start right after you have it now

 

You also need to build the query correctly, you can get an example on how to find the manufacturer name using the product id in box bm_manufacturers.php

 

For option #2, you need to work in file catalog/includes/classes/shopping_cart.php

 

Here you need to modify the existing query of function get_products() , same query example about what tables are used and what the field names are

 

Then you add to the array that comes just after in the same way it is done for all other info pulled from that query

 

Finally you echo the result in file catalog/shopping_cart.php, again same as eg the products name

 

I just don't have time right now to post concrete code

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...