• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Small error in quantity calculation

Small error in quantity calculation 12 years 8 months ago #18715

Hi , i have a little issue with my RSFormpro form and some java calculations:

thegreenwichbaths.com.au/nippers2012

On page 4 there is a "paypal multi product field" "How many children" with
"136|1
272|2
408|3
544|4"
and on the next page another paypal multi page with 1 product "Nippers cap" with a quantity box "20|Standard Size $20" an dteh attribute: onclick="enableQuantity('Size3","QuantityProd1');"

and the form java:
<script type="text/javascript">
 
function calculateTotal(pid,value)
{
//alert(pid);
//alert(value);
price = 0;
products = new Array();
products['Greenwich Baths Nippers Cap|_|Standard Size $20'] = '20';
products['How many children|_|1 '] = '136';
products['How many children|_|2 '] = '272';
products['How many children|_|3 '] = '408';
products['How many children|_|4'] = '544';
 
 var elemc = document.getElementsByName('form[Greenwich Baths Nippers Cap][]');
	for(i=0;i<elemc.length;i++)
	{
		//if(elemc[i].checked == true ) 
		//{
		if(pid == 'QuantityProd2'){
		price += value * parseFloat(products['Greenwich Baths Nippers Cap|_|' + elemc[i].value]);
		//}
		}
	}
	price += parseFloat(products['How many children|_|' + document.getElementById('paypal-345').value]);
 
document.getElementById('paypal_total_10').innerHTML = number_format( price, 2, '.', ',');
document.getElementById('paypal_total_10').value = price;
document.getElementById('Total Payment').value = price;
}
 
 
</script>

The issue is: When you chose the quantity in "How many children" and then choose the quantity of the "Nippers caps" the price is calculated right but if you realize you made a mistake and change the quantity of the "How many children field" the total field ignores the already chosen "Nipers caps quantity" which is very confusing for some customers because they pay teh wrong price then. Are there any errors in my java?

THANKS
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!