Jump to content

PDF display country/state


Recommended Posts

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

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

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

×
×
  • Create New...