Jump to content

Conditional text based on country and payment method (in PDF)


prestatiw

Recommended Posts

Hi everyone,

 

maybe you could give me a hint: I'm trying to show a text, in the invoice/shipping slip (pdf), depending on the destination (delivery address country) and another one depending on payment method.

Any idea how I can get this done? I'm using PrestaShop 1.6.1.6.

 

Thanks in advance and best regards

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

You have two choices:

 

../classes/pdf/HTMLTemplate.php with function assignCommonHeaderData

or

../classes/pdf/HTMLTemplateInvoice.php with function getContent

 

The first would help to use the same data on delivery slips as well, the latter is only used for invoices. The object in the latter is named $delivery_address.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

You can also add a condition into an invoice TPL template (/pdf).

 

{if $delivery_address->id_country == 1}
    show something for country with ID = 1
{elseif $delivery_address->id_country == 2}
    show something for country with ID = 2
{else}
    show something for all other countries
{/if}

 

  • Like 1
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...