We are launching with Rakuten Affiliate and need to implement their tracking pixel. I have the majority working but running into an issue with outputing the Discount amounts assigned to an order. I also need the discount value to output in pennies, which is why you'll see the pennies equation that I copied from the product value output (which works great on that section).
When an order has a coupon code assigned, I need to display the value of only the discounts on the order. So if a coupon code with $55.50 is assigned, it should output only 5500.
Right now the below code outputs: 0|0|0 no matter if there is a discount applied to the order or not.
How do I get the below code to output the correct discount value and only assigned discounts?
Here is the code I am having issues with:
Here is my full tracking pixel code:
When an order has a coupon code assigned, I need to display the value of only the discounts on the order. So if a coupon code with $55.50 is assigned, it should output only 5500.
Right now the below code outputs: 0|0|0 no matter if there is a discount applied to the order or not.
How do I get the below code to output the correct discount value and only assigned discounts?
Here is the code I am having issues with:
Code:
<mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type NE 'TAX' OR l.settings:charge:type NE 'SHIPPING'"><mvt:assign name="l.settings:charge:discount_pennies" value="l.settings:charge::formatted_disp_amt * 100" />|&mvt:charge:discount_pennies;</mvt:if></mvt:foreach>
Here is my full tracking pixel code:
Code:
<!-- Rakutan Tracking Pixel --> <mvt:foreach iterator="charge" array="order:charges"> <mvt:if expr="l.settings:charge:type NE 'TAX' OR l.settings:charge:type NE 'SHIPPING'"> <mvt:assign name="g.order_discount" value="'true'" /> </mvt:if> </mvt:foreach> <img src='https://track.linksynergy.com/ep?mid=42089&ord=&mvt:order:id;&skulist=<mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="item" array="order:items"><mvt:assign name="l.counter" value="l.counter + 1" /><mvt:if expr="l.counter GT 1">|</mvt:if>&mvt:item:code;</mvt:foreach><mvt:if expr="g.order_discount EQ 'true'">|Discount</mvt:if>&qlist=<mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="item" array="order:items"><mvt:assign name="l.counter" value="l.counter + 1" /><mvt:if expr="l.counter GT 1">|</mvt:if>&mvt:item:quantity;</mvt:foreach><mvt:if expr="g.order_discount EQ 'true'">|0</mvt:if>&amtlist=<mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="item" array="order:items"><mvt:assign name="l.counter" value="l.counter + 1" /><mvt:if expr="l.counter GT 1">|</mvt:if><mvt:assign name="l.settings:item:price_pennies" value="l.settings:item:price * 100" />&mvt:item:price_pennies;</mvt:foreach><mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type NE 'TAX' OR l.settings:charge:type NE 'SHIPPING'"><mvt:assign name="l.settings:charge:discount_pennies" value="l.settings:charge::formatted_disp_amt * 100" />|&mvt:charge:discount_pennies;</mvt:if></mvt:foreach>&cur=USD&namelist=<mvt:assign name="l.counter" value="0" /><mvt:foreach iterator="item" array="order:items"><mvt:assign name="l.counter" value="l.counter + 1" /><mvt:if expr="l.counter GT 1">|</mvt:if>&mvt:item:name;</mvt:foreach><mvt:if expr="g.order_discount EQ 'true'">|Discount</mvt:if>' border="0" width="1px" height="1px" alt=""> <!-- End Rakutan Tracking Pixel -->
Comment