flashlight-torches Posted April 4, 2011 Share Posted April 4, 2011 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 LastnameAddress 1Address 2Postcode City <----this is what I am trying to changeCountryI am aiming for:Firstname LastnameAddress 1Address 2CityPostcodeCountryI 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 More sharing options...
ChrisLNZ Posted April 6, 2011 Share Posted April 6, 2011 not tested but try this: $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->city), 0, 'L'.' '.$delivery_address->postcode); Link to comment Share on other sites More sharing options...
flashlight-torches Posted April 7, 2011 Author Share Posted April 7, 2011 I must say it did look promising but unfortunately the postcode does not show. How can this simple change be so complicated? Link to comment Share on other sites More sharing options...
ChrisLNZ Posted April 7, 2011 Share Posted April 7, 2011 agreed - sorry it didn't work Link to comment Share on other sites More sharing options...
flashlight-torches Posted April 8, 2011 Author Share Posted April 8, 2011 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 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