Jump to content

[SOLVED]Edit PDF


Recommended Posts

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

  • 1 month later...
  • 3 months later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...