salvadorbiedma Posted February 9, 2011 Share Posted February 9, 2011 Hello Friends!Im trying to print the variable EAN13 in the PDF Invoice. Y have the following code: $pdf->Cell(0, 0, self::l('EAN13:'.$ean13->value.'.'), ''); $pdf->Ln(10); Why it doesn't work? EAN13 is printed but not the variable which contain the information.I really appreciate your help!Thanks! Link to comment Share on other sites More sharing options...
shokinro Posted February 9, 2011 Share Posted February 9, 2011 Please try this $pdf->Cell(0, 0, self::l('EAN13:') .$product['product_ean13'], ''); $pdf->Ln(10); there are problem in your code1. $ean13 is not object2. date $product['product_ean13'] from database should not be included in self::l() Link to comment Share on other sites More sharing options...
salvadorbiedma Posted February 9, 2011 Author Share Posted February 9, 2011 Hi Shokinro. I have tried what you said but it still doesn't work. When i have the invoice it is printed EAN13: but the content of the variable Ean13 doesnt apper in the Invoice.Thanks for your help! Link to comment Share on other sites More sharing options...
shokinro Posted February 9, 2011 Share Posted February 9, 2011 I checked the PDF file source code.The products information are loaded from ps_order_detail table. In this use product_ean13 instead of ean13.So you need to use $product[product_ean13'] instead of $product['ean13'].I have modified my code in my previous post. Please try the new one. Link to comment Share on other sites More sharing options...
salvadorbiedma Posted February 9, 2011 Author Share Posted February 9, 2011 Hello Shokinro,First of all really thanks for your help.I have tried it again with your new code but it doesn't still works. What about to use supplier reference for this thing? How can it works?Thanks again!! Link to comment Share on other sites More sharing options...
shokinro Posted February 9, 2011 Share Posted February 9, 2011 I just tested following code in PDF, it works fine. Attached is generated PDF invoice. You can see at reference column printed is ean13 code I input at catalog.Replace this line (around line# 698) $this->Cell($w[++$i], $lineSize, ($product['reference'] ? $product['reference'] : '--'), 'B'); with this line $this->Cell($w[++$i], $lineSize, ($product['product_ean13'] ? $product['product_ean13'] : '--'), 'B'); I don't which location you want to print the ean13, so it is difficult to give you an accurate instructions. Link to comment Share on other sites More sharing options...
patrmich Posted May 18, 2013 Share Posted May 18, 2013 Hi, I am using Prestashop 1.4.7.0. I did the following in classes/PDF.php, line 893 : - replacing $this->Cell($w[++$i], $lineSize, $product['product_reference'], 'B'); by $this->Cell($w[++$i], $lineSize, $product['product_ean13'], 'B'); But unfortunately, nothing changed both in the delivery slip and in the invoice. The Reference is still displayed and the EAN13 code is not displayed. Is there any other amendment to make in order to display the EAN13 bar-code on the delivery slip or on the invoice ? Thank you in advance for any help. Patrick Link to comment Share on other sites More sharing options...
patrmich Posted May 18, 2013 Share Posted May 18, 2013 Hi, I finally managed to display the bar-code number in both the delivery slip and the invoice. To get this, I replaced in classes/PDF.php, line 912 : $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? Tools::iconv('utf-8', self::encoding(), $product['product_reference']) : '--'), 'B'); by $this->Cell($w[++$i], $lineSize, ($product['product_ean13'] ? Tools::iconv('utf-8', self::encoding(), $product['product_ean13']) : '--'), 'B'); Is there a way to display, not only the bar-code digits, but also the bar-code image ? Thank you in advance for any help. Patrick 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