WebSite X5Help Center

 
Emile Brown
Emile Brown
User

Html code for pay now button field reports 3, instead of 2 zeros for [price]  en

Автор: Emile Brown
Просмотрено 1362, Подписчики 1, Размещенный 0  

I have used the following HTML code for the "pay now" button field in the Shopping Cart > Wesbsite Settings > Order Management > Payment type List, but it results in 3, instead of 2 zeros for [price]:


<form action="https://sandbox.payfast.co.za/eng/process" method="post">
<input type="hidden" name="merchant_id" value="10000100">
<input type="hidden" name="merchant_key" value="46f0cd694581a">
<input type="hidden" name="amount" value="[PRICE]">
<input type="hidden" name="item_name" value="[ORDER_NO]">
<input type="submit">
</form>

See: https://expomania.co.za/shop-1.html

Please assist

Размещено
5 Ответы - 2 Полезно - 1 Корректно
Axel  
Axel  
User

Hello Emile,

Here the JS code to help you.

https://www.w3schools.com/jsref/jsref_tofixed.asp

If you need help on the payment, I have all these custom gateways already inplemented into WSX5

Hope this helps

Enjoy!
Axel

Читать больше
Размещено От Axel  
Emile Brown
Emile Brown
User
Автор

Thanxalot, Axel

Читать больше
Размещено От Emile Brown
Axel  
Axel  
User

Hello Emile,

If the answer is Ok for you please marks this one with the green thumb like OK to help other users in the futur and close the post.

Enjoy!
Axel

Читать больше
Размещено От Axel  
Emile Brown
Emile Brown
User
Автор

This is how the problem was resolved by my son:cool

<form action="https://sandbox.payfast.co.za/eng/process" method="post">
<input type="hidden" name="merchant_id" value="10000100">
<input type="hidden" name="merchant_key" value="46f0cd694581a">
<input type="hidden" name="amount" value="[PRICE]" id="payfast_amount">
<input type="hidden" name="item_name" value="[ORDER_NO]">
<input type="submit">
</form>

<script>
let payfastAmountElement = document.getElementById("payfast_amount");
let num = +payfastAmountElement.getAttribute('value');
num = num.toFixed(2);
payfastAmountElement.setAttribute("value", num);
</script>

Читать больше
Размещено От Emile Brown
Axel  
Axel  
User

Ok.

Close your ticket if OK for you wink

Читать больше
Размещено От Axel