Jump to content

[Solved] Add Manufacturer in Shopping Cart table


Recommended Posts

Hi,

I tried to change the code of the Shopping-cart.tpl to include the Manufaturer in the table.

So I changed the header of the table by this code:


{l s='Manufacturer'}
{l s='Item'}
{l s='Unit price'}
{l s='Qty'}
{l s='Total'}



And I tried to call the Manufacturer in shopping-cart-product-line.tpl in the column like this:

    
{$product->manufacturer_name|escape:'htmlall':'UTF-8'}



But, as you may have guessed... It doesn't work.
Any idea?

Thanks!

Link to comment
Share on other sites

I checked the code and the manufacturer name isn't passed in to the shopping cart. You'd have to modify the SQL query in the getProducts() function in classes/Cart.php and add the following to the list of left joins:

LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)



then add the following to the SELECT:

m.`name` as manufacturer_name



Then my code above should work.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

I checked the code and the manufacturer name isn't passed in to the shopping cart. You'd have to modify the SQL query in the getProducts() function in classes/Cart.php and add the following to the list of left joins:

LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)

then add the following to the SELECT:

m.`name` as manufacturer_name

Then my code above should work.

 

Thanks!

 

Please help as it will in version 1.4.4 of the manufacturer placed in the shopping cart shopping-cart-product-line.tpl

 

It worked for me on 1.4.3

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...
  • 1 year later...

I checked the code and the manufacturer name isn't passed in to the shopping cart. You'd have to modify the SQL query in the getProducts() function in classes/Cart.php and add the following to the list of left joins:

 

LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`)

then add the following to the SELECT:

 

m.`name` as manufacturer_name

Then my code above should work.

 

 

Hello,

 

I need to display the manufacturer (brand) name in my cart too. I am running PS 1.6.0.9 and can't find the right getProducts() function, nor where to place all that code above. Looks like the code isn't the same since last versions of prestashop.

 

Can somebody help me please? It's been my 15th post with still no answer anywhere on that forum....

Thanks !

Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...