Hello people of the actinic community.
This is a 3 part question really. 1 working solution & 2 questions.
Am looking for a lil guidance. I'm intending to apply a 'Was' 'Now' feel to my items within actinic which have a discount applied against them.
I'm kind of OK with the PHP math side using actinic variable ProductRawPrice and have included where I'm at:
<actinic:block if="<actinic:variable name="DiscountDescriptionIsShownForProducts" />">
<actinic:block php="true">
$vat = "1.2" ;
$discountReward = 20 ;
$strRawPrice = <actinic:variable encoding="perl" name="ProductPriceRaw" selectable="false" /> ;
$intRawPrice = intval($strRawPrice) ;
$discountPrice = number_format($intRawPrice - ($intRawPrice * $discountReward / 100), 2) ;
$nowPrice = number_format($discountPrice * $vat, 2) ;
echo $nowPrice ;
</block>
</block>
Question 1: The above works fine as is, but is a manual entry of the $vat & $discountReward. The $vat I can live with, but is there any way I can use the actinic stored values for reward type & reward value to populate the $discountReward?
Question 2: When an actinic variable referenced is in Italics what does this mean? Have tried to echo the actinic variable 'Adjustments' but can't appear to get this to output.
Question 3: The ultimate aim of this 'Was' 'Now' activity is to somehow populate the google products feed 'sale_price' with the reduced 'Now' value. I have a field within the items (product) detail. How do I apply $nowPrice into this attribute simially to =Price: for Product Price Description.
Sorry to ask... Am sure it's been covered... somwhere... however have looked far and wide but found very little beyound creating a variable and populating it manually. -Perhaps it's not even possible to pull that information out.
Thanks.
This is a 3 part question really. 1 working solution & 2 questions.
Am looking for a lil guidance. I'm intending to apply a 'Was' 'Now' feel to my items within actinic which have a discount applied against them.
I'm kind of OK with the PHP math side using actinic variable ProductRawPrice and have included where I'm at:
<actinic:block if="<actinic:variable name="DiscountDescriptionIsShownForProducts" />">
<actinic:block php="true">
$vat = "1.2" ;
$discountReward = 20 ;
$strRawPrice = <actinic:variable encoding="perl" name="ProductPriceRaw" selectable="false" /> ;
$intRawPrice = intval($strRawPrice) ;
$discountPrice = number_format($intRawPrice - ($intRawPrice * $discountReward / 100), 2) ;
$nowPrice = number_format($discountPrice * $vat, 2) ;
echo $nowPrice ;
</block>
</block>
Question 1: The above works fine as is, but is a manual entry of the $vat & $discountReward. The $vat I can live with, but is there any way I can use the actinic stored values for reward type & reward value to populate the $discountReward?
Question 2: When an actinic variable referenced is in Italics what does this mean? Have tried to echo the actinic variable 'Adjustments' but can't appear to get this to output.
Question 3: The ultimate aim of this 'Was' 'Now' activity is to somehow populate the google products feed 'sale_price' with the reduced 'Now' value. I have a field within the items (product) detail. How do I apply $nowPrice into this attribute simially to =Price: for Product Price Description.
Sorry to ask... Am sure it's been covered... somwhere... however have looked far and wide but found very little beyound creating a variable and populating it manually. -Perhaps it's not even possible to pull that information out.
Thanks.
Comment