2082 Posts in 1002 Topics by 452 members
|Go to End|
14 April 2010 at 7:30am Last edited: 14 April 2010 7:30am
I'm working on a (US) zip code based shipping module for Ecommerce v.6.
First, I added a field named 'ShippingZip' to the OrderForm class. There's a list of 10 zip codes (set in config file similar to Simple Shipping Modifier) that get one rate, and any other zip code gets the default rate.
I thought I was on to something with the populate defaults recipe but still no luck.
If anyone can point me in the right direction on this I'd greatly appreciate it.
14 April 2010 at 9:17am
Figured it out:
Needed to use the AJAX update field functionality (for the country drop down) in the OrderForm and Shopping Cart classes, so set the value of ShippingZip in the session. Shipping Modifier gets updated on AJAX change and reads the value from the session (defined in shopping cart). Also needed to add the input onchange code for ShippingZip to the ecommerce.js file so it would update the form fields on change.
Now that I see how it's setup, it's actually some very nice code behind that functionality.
Hope this helps someone else.
|Go to Top|