I need to know if I can use the forms to calculate a different price for each zip code.
I need to know if I can use the forms to calculate a different price for each zip code.
Please post more details of your situation. How many zip codes are in question, and will the calculations be simple?
I also have a similar question. I am looking to add a service fee based on their zip code. I will have close to 100 zip codes.
Basically I have a form that already calculates a total price but now when they add their address I want to add on a service fee that is based on their zip code.
How can I go about doing this?
I think there are a couple of approaches you could try. One would be to add all your zip codes, as options on your product, and associate the fee with each zip code. Then, when they enter their zip code, use jQuery or JavaScript to make the selection in your options drop down.
Another way to do it would be to break apart the address and use a pre-defined list of zip codes. This would work if you only service specific zip codes, and any zip code outside your list would not be serviced. You could make the zip code drop down an option or a product, although it does not need to look like that to the visitor. That way, choosing their zip code from their list would set the price of the service fee.
One more way to do it would be to query a database or list of zip codes after they enter theirs, and get the service fee and add it to the total. This way is the most complicated.
The last option sound the best as far as the user experience goes. How would I add this code, what would the code be, and where do I put this code?
Thank you for the quick response btw
This would require a substantial amount of code and we would not be able to provide the solution for you. You can always find help on on job board or any of the WordPress-related job sites on the Internet.