Calculator not showing on page.
-
Hello.
I just installed the plugin and tried making a calculator to calculate service fees. It is a tiered calculation. (Currency is in Japanese Yen.) I tried inserting the calculator onto my page using [CP_CALCULATED_FIELDS id=”1″] but nothing shows up. It must be something in my calculator settings since the default calculators show up fine. I have already tried changing the script loading method to Direct.
Here is what I have for my calculator.
fieldname1 is the item cost and fieldnumber2 is the shipping cost, and both are Number type fields. (Would Currency also work?)
I have the service fee calculation (fieldname3) as the following:
(function(){ if (fieldname1<=2500) return 500; if (2500<fieldname1 && fieldname1<=3000) return 700; if (3000<fieldname1 && fieldname1<=4000) return 1000; if (4000<fieldname1 && fieldname1<=5000) return 1500; if (5000<fieldname1 && fieldname1<=10000) return fieldname1*0.3; if (10000<fieldname1) return (fieldname1*0.2)+1000; })();
The upfront fee calculation (fieldname4) is then:
fieldname1+fieldname2+fieldname3
And if the person sends a payment via PayPal as goods/services, I charge a bit extra to cover the fees (fieldname5):
(function(){ if (fieldname4<=1000) return (fieldname4*.1)+fieldname4; if (1000<fieldname4 && fieldname4<=3000) return (fieldname4*.08)+fieldname4; if (fieldname4<3000) return (fieldname4*.05)+fieldname4; })();
Was there anything else I need in the Set Equation field? Or is my equation off? Any help would be appreciated. Thanks.
PS I would also like fieldname3 (service fee) and fieldname5 (total w/PayPal goods/service payment) to be rounded up with no decimals. Could you please tell me how to do that? I know you use
round(x)
but how does one put that afterreturn
? Would it just be something likeround((fieldname4*.05)+fieldname4)
? But would a result of 2.4 for example get rounded to 2? I want to round up.
- The topic ‘Calculator not showing on page.’ is closed to new replies.