Thanks for replying Craig -- you are really helping me think this through.
My first quick fix might be to simply to select the zip code of the vendor with the most weight in packages. Once I pull all the product id's in from the cookies, I can use this query (with my sql setting the product id's where I have (15, 19) in this example):
SELECT zen_subcontractors.subcontractors_id, zen_subcontractors.zip, sum(products_weight) AS fltTotalWeight
FROM zen_products
LEFT JOIN zen_subcontractors ON zen_products.default_subcontractor=zen_subcontractors.subcontractors_id
WHERE zen_products.products_id IN (15, 19) AND zen_subcontractors.zip IS NOT NULL
GROUP BY zen_subcontractors.zip
ORDER BY sum(products_weight) DESC
If I get no results, use the standard store zip code, else use the first zip code returned. A second part of this quick fix might be to add a flat fee for each extra vendor, say $6 (configurable), since we know the first pound of a new shipment always has the overhead.
Now, if I have all the vendor shipping zips, and I know the shipping method per carrier (assume all shippers use ground, next day, etc -- comparable service levels), then it doesn't seem so hard to calc shipping costs for each vendor/carrier (as in for each vendor, calc shipping ...). Add them up, and I've got a total shipping cost.
Now, getting the carrier/vendor/shipping cost per vendor all to display (with the products grouped) and reported (invoices etc.) seems more challenging to me. Not impossible, but far more complex, because it touches so much more of the interface. Maybe you can just point me to the spots that need updating, but I would guess there are many.
My point is really that if I start with my quick fixes, it will cover a lot of the cases (all cases where there is only one product in the basket), and I'm much more likely to do it. Not anywhere near perfect, but it would prevent the worst cases. Right now I could ship to the same zip I'm in and calculate a low rate, when in reality the products are shipped across the country.
So, please continue with my reality check ... I'm sure it is easy to overlook something.
Thx!
Bookmarks