hey guys, i'm new to the forum and to php. I'm trying to subtract two variables like this but it just doesn't want to work, i'm working on a shopping cart software that uses php and this is the code that i need to subtract:
{convertPrice price=$product->getPriceWithoutReduct()-$product->getPrice()}
what is so confusing to me is that the next code (below this paragraph) shows both variables come up with their values in the browser, for example, in the browser this comes up: £10 £9, and all i want is for the variable values to subtract themselves so it comes out as £1
{convertPrice price=$product->getPriceWithoutReduct()}{convertPrice price=$product->getPrice()}
and if i try this:
{convertPrice price=$product->getPriceWithoutReduct()-2}
or
{convertPrice price=$product->getPrice()-2}
the values do get subtracted by 2!!
it only breaks when i try to subtract the vars with each other!
is there any way i can subtract those two variables?
thanks in advance