vallverd Posted October 17, 2010 Share Posted October 17, 2010 Hi, I'm trying to modify invoice pdf but I fail... I would like to change the order of the content. First, the reference and then the description.I managed to change the order of titles but not the content.Any ideas?Thanks, Link to comment Share on other sites More sharing options...
rocky Posted October 18, 2010 Share Posted October 18, 2010 For those who don't know how to switch the description and references headers, you should change lines 568-569 of classes/PDF.php (in PrestaShop v1.3.2) from: array(self::l('Description'), 'L'), array(self::l('Reference'), 'L'), to: array(self::l('Reference'), 'L'), array(self::l('Description'), 'L'), and lines 579-580 from: array(self::l('Description'), 'L'), array(self::l('Reference'), 'L'), to: array(self::l('Reference'), 'L'), array(self::l('Description'), 'L'), You should be able to switch the content in a similar way. For example, try changing lines 668-671 from: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']).' - '.self::l('Customized'), 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->Cell($w[++$i], $lineSize, $product['product_reference'], 'B'); to: $this->Cell($w[++$i], $lineSize, $product['product_reference'], 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']).' - '.self::l('Customized'), 'B'); and lines 687-690 from: $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); to: $this->Cell($w[++$i], $lineSize, ($product['product_reference'] ? $product['product_reference'] : '--'), 'B'); $lineSize = $this->GetY() - $before; $this->SetXY($this->GetX() + $w[0] + ($delivery ? 15 : 0), $this->GetY() - $lineSize); $this->MultiCell($w[++$i], 5, Tools::iconv('utf-8', self::encoding(), $product['product_name']), 'B'); Link to comment Share on other sites More sharing options...
andypierces Posted October 20, 2010 Share Posted October 20, 2010 Try this free PDF to Word Converter, works well for me. Link to comment Share on other sites More sharing options...
vallverd Posted November 21, 2010 Author Share Posted November 21, 2010 Thanks RockyI've seen a module that you can customize all email documents, invoices ...http://www.modules-for-prestashop.com/modules/3-pdf-extensions.html Link to comment Share on other sites More sharing options...
ctc Posted March 9, 2011 Share Posted March 9, 2011 Hi Vallverd, that module looks good, but it's so expensive! Surely there is an easier way to make these adjustments without having to shell out so much money... In the meantime I'll have to look at customising the PDF.php text as per Rocky's suggestions 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