I’m trying to make a price calculator for my friend’s car shipping company. It seemed like a simple thing to do but with my skills I’m having some problems. The calculator takes the distance from zipcode 1 to zipcode 2, and mutplies the total miles by .32 to get the base price. No problems here.
Then I need to see if both zip codes are part of a large metro area, if not there’s a 30% increase in price. I got this working properly too.
The next step is to get the customer car type and additional costs depending on the car category. SS for small sedan, MS for a medium Sedan and so on.
I used a fairly plain JS to get the conditional drop down and assign the right values. When the form is submitted I seem to get the right calculation for the additional car cost - (7% for a medium sedan) but when I try to add this to the total price it doesn’t calculate.
I’m also having a problem adding a checkbox value to the total. I get the correct value when the checkbox is checked but I need to sum all of them up.
Would anyone please be able to provide with some insight on how to add the total price for all the variables together?
Thank you for reading my post.