Hi All,
On a site we are doing we have added a new variable called RecommendedRetailPrice to a Products details.
What we would like to do is run a calculation based on this variable and the Price of the product.
So, we could show the RRP, then a "Save £xxx" then "Our Price £xxx".
So, we have put in a block if asking if the RecommendedRetailPrice is >0
If it is then display the RRP followed by the RRP minus the Price
Question is, can I build the calculation using blocks? Or should I be using php, along the lines of...
The code above gives a parse error in the preview window, but this is probably because it is not running on a server to run the php. I can upload it at the moment to test, as uploading another site at the moment.
What would be your thoughts? The php should run OK - or better to do thi9s with a calculation in a block or condition etc?
On a site we are doing we have added a new variable called RecommendedRetailPrice to a Products details.
What we would like to do is run a calculation based on this variable and the Price of the product.
So, we could show the RRP, then a "Save £xxx" then "Our Price £xxx".
So, we have put in a block if asking if the RecommendedRetailPrice is >0
If it is then display the RRP followed by the RRP minus the Price
Question is, can I build the calculation using blocks? Or should I be using php, along the lines of...
Code:
<p>RRP: £<actinic:variable name="RecommendedRetailPrice" /></p> <p>SAVE £<actinic:block php="true"> $rrp = intval(<actinic:variable name="RecommendedRetailPrice" selectable="false" />); $price = intval(<actinic:variable name="Price" selectable="false" />); $saving = $rrp-$price; echo $saving; </actinic:block> </p>
What would be your thoughts? The php should run OK - or better to do thi9s with a calculation in a block or condition etc?
Comment