Hi all. I’ve got what is likely a fairly simple problem, but I haven’t been able top find a good example and I am new to JS.
I am implementing a shopping cart program and the shipping calculation is not robust enough to support our needs. What I want to do is create a custom function to calculate the shipping cost based on three varialbes and then pass the result on to the shopping cart. The shopping cart shipping calculation would be turned off.
So, when the customer wants to buy a product, they must select values from three separate drop downs: Number of products to order, Shipping zone, and Type of service. For example, 2 widgets, being shipped to zone 4, using ground service. Based on the values selected in the drop downs, an array/table should be searched to match on those three values and retrieve a fourth value, which would be the shipping cost for that combination. The resulting shipping cost will then be passed on to the cart program.
I would greatly appreciate any help or insight that anyone could provide. Well documented examples are especially appreciated!
Thanks everyone!