Jump to content

PS 1.4.7.3 PDF header address customization


Recommended Posts

I'm trying to customize the invoice-/orderslip header address in Prestashop 1.4.7.3

 

I did my homework: Searching the forums, searching with google, reading the developer documentation and the fpdf homepage. I've tried editing classes/PDF.php with little to no effect.

 

My problem is, i can't find out where the address format is stored. For example i need to put the company name above the name, add the phone number at the end of both addresses and switch the position of invoice and delivery address.

 

I'm not asking for a complete guide, but i would certainly be grateful for some pointers. Thank you!

Link to comment
Share on other sites

@tuk66

Thank you, i feel a bit stupid for overlooking the address format options in the backend...

Anyway, all i could change there was the order, at least now i have the firm on top.

 

I found a solution for switching the position of Invoice and Delivery though:

File: classes/PDF.php

 

1.)

Line: ~576

Action: switch the following lines of code

$pdf->Cell($width, 10, self::l('Invoicing'), 0, 'L');

$pdf->Cell($width, 10, self::l('Delivery'), 0, 'L');

 

2.)

Line: ~582

Action: switch the following lines of code

'invoice' => array(),

'delivery' => array(),

 

Hope this helps anyone!

Edited by -drj- (see edit history)
Link to comment
Share on other sites

  • 4 months later...

Hi everybody, I've been trying to make some other changes as well and have no idea how to.

 

I need to place my company address on top of everything. Same format as it appears in the footer, but in the header.

 

I guess, if I'm not wrong, I see in the class/pdf.php this code:

 

/**
* Invoice header
*/
public function Header()
{
 global $cookie;
 $conf = Configuration::getMultiple(array('PS_SHOP_NAME', 'PS_SHOP_ADDR1', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_STATE'));
 $conf['PS_SHOP_NAME'] = isset($conf['PS_SHOP_NAME']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_NAME']) : 'Your company';
 $conf['PS_SHOP_ADDR1'] = isset($conf['PS_SHOP_ADDR1']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_ADDR1']) : 'Your company';
 $conf['PS_SHOP_CODE'] = isset($conf['PS_SHOP_CODE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CODE']) : 'Postcode';
 $conf['PS_SHOP_CITY'] = isset($conf['PS_SHOP_CITY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_CITY']) : 'City';
 $conf['PS_SHOP_COUNTRY'] = isset($conf['PS_SHOP_COUNTRY']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_COUNTRY']) : 'Country';
 $conf['PS_SHOP_STATE'] = isset($conf['PS_SHOP_STATE']) ? Tools::iconv('utf-8', self::encoding(), $conf['PS_SHOP_STATE']) : '';
 if (file_exists(_PS_IMG_DIR_.'/logo_invoice.jpg'))

 

but I'm not sure if this code should display my shop address or not? in case it should, it is not doing it. My pdf files only show the logo and then the address of the customer (Delivery / Invoicing).

 

I need, more or less, to make these changes to have my pdf files (most important the invoice) according to the German laws:

 

 

My shop address

(small font, as it is now in the footer, or in a block aligned to the right side of the header including website address and email)

 

My shop Logo

 

Invoice/Order number

 

Customer Name

Customer address

Customer email

 

Date

 

 

Product details table

 

Total shipping

Total discounts

Total

 

Footer
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...