Jump to content

Adding custum field in invoice


rad954

Recommended Posts

Hi I am new in prestashop

I want to custumize my invoice so it displays the price in letter:

for example if total price is 180 dollars I want to display "the total price is one hundred dollars" ;

I have found a php function that convert a price wirtten in numbers to letters (it takes as parameters the currency and the price and returns the price in letters) but i don't know how to use it and where to call it

I'll appreciate any help !!

thank you in advance

Link to comment
Share on other sites

Hi Rad,

 

You'd need to edit the invoice tpl file.

 

Once you open the. Tpl file you'll see lots of other functions called so just copy the format of one of those functions and paste it where you want the field to discuss display, then replace the function parts with your function.

 

You should know what I mean once you open up the Tpl file - make sure you make a copy of the original first though. A bit of trial and error and you should be there.

 

If you do struggle post your function back here and I'll see if I can put the code together, but do have a go yourself first see if you can pick it up how to do it, then next time you have a similar issue you'll know exactly what to do!

 

Cheers

 

Jgriff

Link to comment
Share on other sites

You may have to put the php code in a module and get it into the smarty variable space via the hook:

displayPDFInvoice

Although that's intended to allow you to insert a complete block in the invoice you can likely use it to insert variables too and just return nothing. Your issue is that you cannot (and shouldn't) execute php inside a smarty template.

Edited by Paul C (see edit history)
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...