{if $cart.payment_surcharge}<br />
<li id="payment_surcharge_line"><br />
<span>{$lang.payment_surcharge}:</span><br />
<strong>{include file="common_templates/price.tpl" value=$cart.payment_surcharge span_id="payment_surcharge_value"}+{[COLOR="Red"]$varX}[/COLOR]</strong><br />
</li><br />
{math equation="x+y" x=$cart.total y=$cart.payment_surcharge assign="_total"}<br />
{/if}<br />
```<br />
<br />
in my mind, it should be show some number + some random number<br />
am i wrong?<br />
thank you
Not sure what you’re trying to accomplish, but your going to end up with a bunch of garbage for your html. If you want to add your variable to the amount returned by the price.tpl include then you should do something like:
The surcharge is part of the product_data. So if you use the ‘get_product_data’ PHP hook you can set that amount there. It will then go through to the template as the surcharge.
But because this is random, when the item is added to the cart, the product data is going to be fetched again and a new surcharge will be applied.
Why would you want a random surcharge anyway? Pretty hard to build a random business model.