keweli Posted September 25, 2010 Share Posted September 25, 2010 Hi, in the PDF.php file I'm trying to only print either the state or country.These give me both: .iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState->name)). .iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' '.$deliveryState->name : '')). So is it possible to separate them? Link to comment Share on other sites More sharing options...
rocky Posted September 25, 2010 Share Posted September 25, 2010 Do you mean that you want them on separate lines or do you want the state displayed only and the country displayed if a state doesn't exist? Link to comment Share on other sites More sharing options...
keweli Posted September 25, 2010 Author Share Posted September 25, 2010 I want them separated completely basically.For instance a line saying: "Your state is NSW".Another line saying: "You are in Australia".thanks! Link to comment Share on other sites More sharing options...
rocky Posted September 25, 2010 Share Posted September 25, 2010 Then change it from: $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->country.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L'); to: $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), 'Your state is '.($deliveryState ? ' - '.$deliveryState->name : '')), 0, 'L'); $pdf->Ln(5); $pdf->Cell($width, 10, Tools::iconv('utf-8', self::encoding(), 'You are in '.$delivery_address->country), 0, 'L'); Link to comment Share on other sites More sharing options...
keweli Posted September 25, 2010 Author Share Posted September 25, 2010 Hi,Thanks, I tried it but the result isn't what I wanted. This is what I got:Your state isYou are in NSW, AustraliaIs the state stuck with the country? Link to comment Share on other sites More sharing options...
rocky Posted September 25, 2010 Share Posted September 25, 2010 No, it shouldn't be. I don't understand why that is happening. Did you modify classes/PDF.php to add the state before the country? Link to comment Share on other sites More sharing options...
keweli Posted September 25, 2010 Author Share Posted September 25, 2010 I see 2 places with the line that you told me to replace.This: $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); and this: $pdf->Cell($width, 10, $delivery_address->postcode.' '.Tools::iconv('utf-8', self::encoding(), $delivery_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'); I replaced the first one and got the result I said before Link to comment Share on other sites More sharing options...
Recommended Posts