Copy link to clipboard
Copied
Hi There! Super new to all of this so bare with me. There are 2 form fields that I am trying get to automatically calculate the tiered discount and tiered shipping... according to what the Subtotal is.
The TOTALDiscount Field and the TOTALSHIPPING field.
TOTALDiscount- I need to automatically calculate the discount received according to the SUBTOTAL and the following tier:
5% discount off of Subtotal for Subtotal that is $3500-$6999
10% discount off of Subtotal for Subtotal that is $7000 or more.
TOTALSHIPPING - I need to automatically calculate the shipping cost according to the SUBTOTAL and the following tier:
15% calculation of Subtotal if Subtotal is $1-$500
10% calculation of Subtotal if Subtotal is $501-$1000
7% calculation of Subtotal if Subtotal is $1001-$5000
4% calculation of Subtotal if Subtotal is $5001 or more
I hope this makes sense! Thank you for your help!
Copy link to clipboard
Copied
Put script as "Custom calculation script" in:
TOTALDiscount:
var sub = this.getField("SUBTOTAL").value;
if(sub >= 3500 && sub <= 6999) event.value = sub*.05;
else if(sub >= 7000) event.value = sub*.10;
else event.value = "";
TOTALSHIPPING:
var sub = this.getField("SUBTOTAL").value;
if(sub >=1 && sub <=500) event.value = sub*.15;
else if(sub >=501 && sub <=1000) event.value = sub*.10;
else if(sub >=1001 && sub <=5000) event.value = sub*.07;
else if(sub >=5001) event.value = sub*.04;
else event.value = "";
Copy link to clipboard
Copied
OH! I am using Adobe Acrobat Pro DC
Copy link to clipboard
Copied
Use Javascript at Custom Calculation Script.
Copy link to clipboard
Copied
Put script as "Custom calculation script" in:
TOTALDiscount:
var sub = this.getField("SUBTOTAL").value;
if(sub >= 3500 && sub <= 6999) event.value = sub*.05;
else if(sub >= 7000) event.value = sub*.10;
else event.value = "";
TOTALSHIPPING:
var sub = this.getField("SUBTOTAL").value;
if(sub >=1 && sub <=500) event.value = sub*.15;
else if(sub >=501 && sub <=1000) event.value = sub*.10;
else if(sub >=1001 && sub <=5000) event.value = sub*.07;
else if(sub >=5001) event.value = sub*.04;
else event.value = "";
Copy link to clipboard
Copied
THANK YOU SOOOOO MUCH!! It works perfectly!!
Thank you!