| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Arithmetic operators produce no result with variables | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I am trying to re-format the invoice/order email and am using a html table to contrl the layout.
When I try to get a line total, however, I cannot get the product of the qty and price variables. My code at the moment: <td width=15%><font face="Arial" size=2>({$products[prod_num].price} * {$products[prod_num].amount})</font></td> This produces a result like: (14.95 * 10) instead of the desired result 149.50 I have tried many variations on the PHP syntax but can't get anything to work. Enclosing this formula with <? ... ?> only yields a blank. What am I missing? Would greatly appreciate some help. Thanks Greg
__________________
Always prompt, no matter how long it takes.. Greg at Willow-world |
|||||||
#2
|
|||||||
|
|||||||
![]() <td width=15%><font face="Arial" size=2>({math equation="x * y" x=$products[prod_num].price y=$products[prod_num].amount format="%.2f"})</font></td>
That should do it. "format="%.2f"" simply keeps the decimel places to two, in case you were wondering. So output should be 149.50. |
|||||||
#3
|
|||||||
|
|||||||
![]() MAD, your blood's worth bottling!!!
Worked a treat - thanks heaps. ![]()
__________________
Always prompt, no matter how long it takes.. Greg at Willow-world |
|||||||
|
|||
X-Cart forums © 2001-2020
|