fornoone Posted September 30, 2012 Share Posted September 30, 2012 (edited) Hi guys!! I'd like to display the manufacture's name of a product in the block cart resume (just the name, no link at all...). I suposed this should be really easy but i can't get it working.... I'm quite newbie in PS... I'm using PS 1.5.0.17 I would really appreciate your help. Edited July 16, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
fornoone Posted October 3, 2012 Author Share Posted October 3, 2012 No answers?? The closest i get is to display the manufacturer id {$product.id_manufacturer} But i need to display just the name... i've tried several things: {$product.manufacturer_name} {$product->manufacturer_name} with no result... Please, help!! Link to comment Share on other sites More sharing options...
ByScripts Posted July 16, 2013 Share Posted July 16, 2013 Same question here. Why is this topic marked as solved? Thank you. Link to comment Share on other sites More sharing options...
Martin Uker K Posted July 16, 2013 Share Posted July 16, 2013 Hi ByScripts, As for why is this post "solved" it must be the main user who changed it. To be sure to help you I'll need some informations : What's your version of Prestashop? You want to display it on the shopping-cart.tpl (Cart Resume)? Do you want only the name? There's a lot of way to achieve this, it all depends on your situation. Martin Link to comment Share on other sites More sharing options...
ByScripts Posted July 16, 2013 Share Posted July 16, 2013 Hi, thank you for your answer. I'm using the last version of Prestashop (1.5.4.1). I just need the manufacturer name. I want it to be displayed in "blockcart.tpl". In the products loop, $product only contains the manufacturer ID, but not the name. I suppose that a SQL query must be changed to retrieve the name. Thanks. Link to comment Share on other sites More sharing options...
Martin Uker K Posted July 16, 2013 Share Posted July 16, 2013 I want it to be displayed in "blockcart.tpl". Block cart is the block loaded on every pages. That isn't just the summary. Almost every pages/modules who are displaying cart products uses "cart->getProducts". If you are familiar with Prestashop, I suggest you override this function from classes/cart.php: /** * Return cart products * * @result array Products */ public function getProducts($refresh = false, $id_product = false, $id_country = null) Good luck! Martin Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2013 Share Posted July 16, 2013 author of this thread marked it as [solved] without solution, im going to unmark it Link to comment Share on other sites More sharing options...
ByScripts Posted July 16, 2013 Share Posted July 16, 2013 Block cart is the block loaded on every pages. That isn't just the summary. Almost every pages/modules who are displaying cart products uses "cart->getProducts". If you are familiar with Prestashop, I suggest you override this function from classes/cart.php: /** * Return cart products * * @result array Products */ public function getProducts($refresh = false, $id_product = false, $id_country = null) Good luck! Martin Thank you ! It helped a lot ! Here is a (the?) solution: - Create the file /override/classes/Cart.php - Make a Cart class extending CartCore - Copy the original getProducts - Near line 28, after p.`id_manufacturer` add , m.`name` AS manufacturer_name - Then near line 38, after $sql->leftJoin('product', 'p', 'p.`id_product` = cp.`id_product`'); add this line : $sql->leftJoin('manufacturer', 'm', 'm.`id_manufacturer` = p.`id_manufacturer`'); It's now possible to use $products->manufacturer_name Thanks again. author of this thread marked it as [solved] without solution, im going to unmark it Thank you. I suppose you can now mark it as Solved again Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2013 Share Posted July 16, 2013 haha so funny thanks for solution and confirmation that everything works as you expect regards Link to comment Share on other sites More sharing options...
Martin Uker K Posted July 16, 2013 Share Posted July 16, 2013 That was the solution I had in mind too. Easier to go and modify the SQL request since it's on every pages. I'm a purist, I wouldn't have added the LEFT JOIN if the requierement for manufacturer name were just on the Summary (1 page). Join affects performance a lot in SQL. Since this function is called everywhere, it would've been a waste of time to join a table unused. I would probally have added all the manufacturers concerned in the accessable vars. (ParentOrderController->_assignSummaryInformations) @vekia Are you ubiquitous?? Or are you just stalking me? Martin Link to comment Share on other sites More sharing options...
www.exclusivepen.eu Posted January 31, 2014 Share Posted January 31, 2014 Hi all. I would like to add the manufacturer name in front of product name in Back office/order page/product line. It is the line which shows what product customer bought. Please see attachment. I run PS 1.5.3. Thank you very much for help. Link to comment Share on other sites More sharing options...
explodedk Posted June 23, 2014 Share Posted June 23, 2014 could anyone make a how to for prestashop 1.6 ? can't seem to figure out how to do it - seem to brake more than i fix Link to comment Share on other sites More sharing options...
Recommended Posts