Jump to content

A simple job for someone fluent in php? split this line into two.


Recommended Posts

Hi there,
I have fiddled with this but as I get close the whole thing just breaks.

I am trying to accomplish what would hopefully be a simple task, trouble is trial and error is not working this time, can someone with php skills please help.

I am trying to slightly re-arrange two lines on the generated PDF invoices and delivery slips.

Currently the address is formatted as follows:

Firstname Lastname
Address 1
Address 2
Postcode City <----this is what I am trying to change
Country


I am aiming for:

Firstname Lastname
Address 1
Address 2
City
Postcode
Country

I believe this bit of code taken from classes/PDF.php is the part that needs splitting and re-arranging:

$pdf->Cell($width, 10, $delivery_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L');
       $pdf->Cell($width, 10, $invoice_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $invoice_address->city), 0, 'L');
       $pdf->Ln(5);
       $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L');
       $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $invoice_address->country.($invoiceState ? ' - '.$invoiceState->name : '')), 0, 'L');
       $pdf->Ln(5);



Any help really appreciated.

Link to comment
Share on other sites

Thanks for the suggestion but when I test by viewing the invoice in admin it usually automatically downloads the file to my local machine for viewing. However after the edit the page just returns a blank page and no file is downloaded or viewable.

I guess there must be more than just the section we have tried editing?

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