Mathematical operations in templates

General ShopSite user discussion

Mathematical operations in templates

Postby gene » Sun Mar 08, 2009 11:02 pm

I wanted to add mathematical formulas in templates. For example in the product template, I wanted to show customers the % discount of an item. How do the template do this? I tested the product template and write, say, (1 - Sale Price/Retail Price)*100 where Sale Price and Retail Price are pulled out from database. However, when published, it just show what I write.
gene
 
Posts: 122
Joined: Mon Feb 09, 2009 10:54 pm
Location: Philippines

Postby Jim » Mon Mar 09, 2009 5:52 am

There are no math functions in the template code. You would have to use the CALL tag and send the parameters to a script that you write and have it return the answer.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: Bing [Bot] and 104 guests