Shipping Calculation Project
Calculate Your Order
Please Select a Product
Shipping State (Tax Purposes):
Standard UPS - 3 Days
US Mail - 5 Days
Overnight - 1 Day
Your Total is:
Create a function called getShipping that is called when you click the "Calculate My Order Now" button.
When a product is selected the function should get the price from the selected product and store it in a local variable.
Take the quantity entered on the form and store it in a local variable.
Calculate a salesTotal using price * quantity.
When the taxing state is selected, determine the tax rate based upon the selected state.
Calculate the tax amount on the sales total. Store the tax amount in a local variable.
When the Delivery Method is selected the function should get the delivery fee percentage from the selected Delivery method.
Determine the shipping cost based upon the selected shipping method.
Determine the total bill by adding the sales total, tax amount, shipping cost and place it the total field.
Format the total amount by using a dollar format function.