Jump to content

Print a message on the invoice


Recommended Posts

Hi to all!

 

I would like to print a message (a message of the law applied) on the invoice only if issued by certain country, with certain ISO code, how do this? 
 
In essence they are all the country, except for those that are in the list "IT Standard Rate (22%)" of the Tax Rules.
 
Please help!
Link to comment
Share on other sites

I think, you could add some condition to /classes/pdf/HTMLTemplateInvoice.php, getContent() function, where both addresses are fetched. You have very little changes to do it right in the invocie.tpl template.

Thanks tuk66! I'm new to PrestaShop, you can suggest me how to do?

Link to comment
Share on other sites

  • 1 month later...

I'm sure you can patch PrestaShop core code. The question is if it would be faster, cheaper and resistant after upgrade.

 

In M4PDF it could work like this:

{assign var="iso" value="`$order[orders].address_invoice.country.iso_code`"}
{if $iso == 'IT' || $iso == 'OTHER_ISO'}
    {l s='Message no. 1' mod='m4pdf'}
{else}
    {l s='Message no. 2' mod='m4pdf'}
{/if}
Link to comment
Share on other sites

  • 2 weeks later...

You need to know at least a little HTML and PHP to do this. Files to edit are:

 

1) /classes/pdf/HTMLTemplateInvoice.php (define a variable)

2) /pdf/invoice.tpl (call the variable)

I know a bit of HTML and PHP, however, you'd know give me some clear indication on how to do?

Link to comment
Share on other sites

×
×
  • Create New...