sjohanna Posted September 7, 2010 Share Posted September 7, 2010 Hi,I already posted my question on this topic: http://www.prestashop.com/forums/viewthread/7366/#296712But as it is marked "Solved", I don't think anybody will look at it.I tried the solution explained in that post but it didn't work.I just want to get the Manufacturer Name before the Product Name in the table of the invoice.It is quite important for my project as Manufacturer are "Restaurants".Thank you in advance for your help!! Link to comment Share on other sites More sharing options...
rocky Posted September 8, 2010 Share Posted September 8, 2010 Try changing line 575 of classes/PDF.php (in PrestaShop v1.3.1) from: global $ecotax; to: global $ecotax, $cookie; then change line 643 from: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']).' - '.self::l('Customized'), 'B'); to: $productObj = new Product($product['product_id'], true, intval($cookie->id_lang)); $manufacturer_name = ''; $manufacturer = new Manufacturer($productObj->id_manufacturer, intval($cookie->id_lang)); if (Validate::isLoadedObject($manufacturer)) $manufacturer_name = $manufacturer->name . ' '; $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $manufacturer_name.$product['product_name']).' - '.self::l('Customized'), 'B'); and line 666 (after the above change) from: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); to: $productObj = new Product($product['product_id'], true, intval($cookie->id_lang)); $manufacturer_name = ''; $manufacturer = new Manufacturer($productObj->id_manufacturer, intval($cookie_id_lang)); if (Validate::isLoadedObject($manufacturer)) $manufacturer_name = $manufacturer->name . ' '; $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $manufacturer_name.$product['product_name']), 'B'); This should add the manufacturer name in front of the product name. Link to comment Share on other sites More sharing options...
sjohanna Posted September 8, 2010 Author Share Posted September 8, 2010 Thanks a million for the answer.I replaced the codes in both areas but when nothing changed on the PDF. I still only have the Product Name.Did you test it?I am sorry... I am not good enough in php/smarty to see if there is a problem in you code...Maybe something need be called from the database?Thank you Link to comment Share on other sites More sharing options...
rocky Posted September 9, 2010 Share Posted September 9, 2010 I've updated my code above. Please try again. It turns out I only modified the customised products and not the non-customised products. It should change both of them now. I can't test it though, since I don't have any manufacturers on my test site at the moment. Link to comment Share on other sites More sharing options...
sjohanna Posted September 9, 2010 Author Share Posted September 9, 2010 THANK YOU!!!!!Thank you so much!!!I will mark the post Solved.You seem pretty good with Prestashop... If you have a minute, would you mind looking at this problem here: http://www.prestashop.com/forums/viewthread/64157/development/display_subcategories_titles__products_on_category_pageNo worries if you can't.Thanks again! Link to comment Share on other sites More sharing options...
havegang Posted March 12, 2012 Share Posted March 12, 2012 Hi Does this work in version 1.4.7.0? /Michael Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now