Jump to content

[Solved] How to insert customers VAT number to mailalerts template


Recommended Posts

Hi all,

Can you please somebody help how to insert customers VAT number to the new order template for merchant in Mailalerts module in Prestashop 1.4.2.5? I must add some directives to mailalerts.php, but I don't know how do I do this.

Thanks a lot

Link to comment
Share on other sites

The VAT number is stored along with the customers Address, so you first need to decide if you want to display the VAT for both delivery and invoice address, or just one of them.

after deciding that, then edit the new_order.html and new_order.txt files and add a new parameter exactly where you want the vat to appear, give it a name like {delivery_vat} and {invoice_vat}

then edit mailalerts.php and find the code that sets the templateVars variables in the 'hookNewOrder' function.
you want to add 2 new array keys like

            
'{delivery_vat}' => $delivery->vat_number,
'{invoice_vat}' => $invoice->vat_number,

  • Like 4
Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

ThanX Bellini!

It is good to solve my problem: vat/iva displayed into invoice in prestashop 1.5.3.

Modify HTMLTemplateInvoice.php and invoice.tpl

In the first add in the array

'invoice_vat' => $invoice_address->vat_number,

'invoice_dni'=> $invoice_address->dni

 

in the second file add:

 

<br>

 

C.F.: {$invoice_dni}

 

 

 

<br>

P.Iva/Vat: {$invoice_vat}

 

Bye.

Edited by fulnet (see edit history)
  • Like 4
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

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...