MakeOpen Posted November 3, 2008 Share Posted November 3, 2008 Hi there,I would like to add the product manufacturers on the prestashop invoices.In classes/PDF.php (line 438) I found : $this->MultiCell($w[0], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); I would like to do something like : $this->MultiCell($w[0], 5, Tools::iconv('utf-8', self::encoding(), $product['manufacturer_name'].' '.$product['product_name']), 'B'); ... but $product['manufacturer_name'] don't exist in this file.If anyone know the good syntax...Thanks for your help !Bye Link to comment Share on other sites More sharing options...
Paul C Posted November 3, 2008 Share Posted November 3, 2008 Hmm probably something like: $this->MultiCell($w[0], 5, Tools::iconv('utf-8', self::encoding(), Manufacturer::getNameById($product['id_manufacturer']).' '.$product['product_name']), 'B'); But I haven't really checked it out properly, so could well be wrong Paul Link to comment Share on other sites More sharing options...
MakeOpen Posted November 3, 2008 Author Share Posted November 3, 2008 Hmm probably something like:But I haven't really checked it out properly, so could well be wrong Paul Good idea, but $product['id_manufacturer'] return nothing, and Manufacturer::getNameById(1) works !I see a light ! :-) 1 Link to comment Share on other sites More sharing options...
MakeOpen Posted November 4, 2008 Author Share Posted November 4, 2008 Up !Anyone know why $product['id_manufacturer'] return nothing in classes/pdf.php ?thanks ! Link to comment Share on other sites More sharing options...
Paul C Posted November 4, 2008 Share Posted November 4, 2008 I've had a quick look at pdf.php, and the only reference I can see to the code you're quoting is in ProdReturnTab which is for product returns....The function ProdTab looks more promising! (Although I'm looking at the 1.1 beta code, so the method may have changed)You'll first need to modify $header and $w with the column names and column widths as appropriate.In Order.php you'll need to modify the getProducts() member function to also fetch id_manufacturer for the product (it's not currently returned in the array).Then you'll need to alter the ProdTab function to output the manufacturer name in the PDF document.Not as trivial as it first appears!!Paul Link to comment Share on other sites More sharing options...
MakeOpen Posted November 5, 2008 Author Share Posted November 5, 2008 OK. I solved the problem like this : $fabricant = Db::getInstance()->ExecuteS(' SELECT id_manufacturer FROM `'._DB_PREFIX_.'product` WHERE `id_product` = '.intval($product['product_id'])); $this->MultiCell($w[0], 5, Tools::iconv('utf-8', self::encoding(), Manufacturer::getNameById($fabricant[0]['id_manufacturer']).' - '.$product['product_name']), 'B'); Link to comment Share on other sites More sharing options...
sjohanna Posted September 7, 2010 Share Posted September 7, 2010 Hi there,I tried to add the last bit of code into my class > PDF but it doesn't work.Do I need to change somthing in "Order.php" as well to call the manufacturer?Thank you Link to comment Share on other sites More sharing options...
mpoohv Posted April 7, 2013 Share Posted April 7, 2013 Any one knows, if there is working solution to display manufacture name on PDF invoice for PS > 1.5 ? Link to comment Share on other sites More sharing options...
mpoohv Posted April 15, 2013 Share Posted April 15, 2013 Is there anyone with a solution for 1.5? I cannot immagion that knowbody want to not display the manufacture name on the invoice. I think it is a pretty logical to have that. Both for yourseld (shop owner) and for the customer. Thanks in advance! 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