Thanks for the encouragement, Showtime. I think at this point I've actually got a functional product!
If you're using git, I've set up a GitHub repository: git clone git://github.com/magiccoder/Zen-Cart-Multiple_Addresses_Mod.git.
And if you're not using git, you can get the source here:
http://magiccoder.com/zen-mod.zip
I've attempted to keep track of all my changes, so any of the Zen-Cart developers can follow along. Pretty much anywhere I've made a change I've added the comment "//Multiple Addresses Mod". So searching for that string will give you most, if not all, of the modified files.
My basic approach was to build a $_SESSION variable with the multiple address info, and then split up the order for each address to calculate the different shipping and tax rates. There is probably a better way to do this, but it appears to work for the situation my client was in, and a different situation might require a different solution. I'm hoping it works for someone else out there as well.
Please note that if you install this mod, you won't be able to upgrade to newer versions of Zen-Cart, such as 1.5, without doing some serious code re-writing. This might pose a security problem as vulnerabilities are discovered in the 1.3.9h code-base. Just a heads up.
And one other thing worth noting is that some of the payment gateways, such as PayPal, only accept a single shipping address with their API, so if you're using PayPal for your shipping information, PayPal won't see the multiple addresses. I considered contacting PayPal about this, but that just seemed like getting way more involved than was strictly necessary. Maybe someone out there who has a connection to PayPal would be interested in discussing this with them? As it sits, PayPal (and AuthorizeNet, etc.) will only see the default shipping address, and not the multiple addresses. I don't think this should be a problem, but you never know.
I would be more than happy to help anyone out there install this mod on their site, just PM me and we can work out the details. You can still check it out at
http://magiccoder.com/zen-mod/ to see if it will suffice for your needs.
Thanks again to everyone for testing it out and for your feedback!
Bookmarks