Help on php ?

I made a new payment_proccecor for my e-shop i want to pass a calculated value at the “payment_surcharge” field on storefront at chekout page but i dont know the way to do this on cc_outside.tpl, i try different ways but nothing happens.



I would appreciate if someone could help me with this.

Why woud you want to calculate the value in the template versus the checkout controller (the php code that stores the info from cc_outside.tpl) in the checkout process. This is where I'd adjust the surcharge dymaically.

Thats the way i do it, all the calculations are made in the (cc_outside.tpl) but i don't know how to pass the value at the $cart.payment_surcharge.



Example

I have a product that costs 1.000$ if you pay cash

and the customer have another 3 options to pay for this



1.To pay for that with 2 installments of 520$ sum 1040 $ different for surcharge is 40$

2.To pay for that with 3 installments of 350$ sum 1050 $ different for surcharge is 40$



3.To pay for that with 4 installments of 270$ sum 1080 $ different for surcharge is 80$