Hi all. Ive found several places where posts and possible solutions within the forums... I have a slightly different problem..
Most of my cart products can ship *either* UPS or USPS, along with all options I offer (customer is permitted to choose) . However..
For both the shipping calculator, AND the actual checkout process, here is what I need to do:
Certain aerosol products are not allowed to ship by air freight (which means they may not ship next day or express) - and must ONLY ship ground freight. Because of this, USPS shipping is also not permitted on these products. (Only ships UPS ground)
Currently, such items are posted in my store as "Ships UPS only" , however there is no way to prevent customers from selecting next day, or USPS shipping during checkout..
So what I need to do is have a way to flag certain product id's that are only allowed to ship by UPS ground - That's no trouble (I'll add that in to the appropriate areas of admin side of cart , and brain dead simple to pop in a simple database table containing the product id's)
Oh by the way I am somewhat of an accomplished programmer in php myself, though that is not my primary line of work :) So, making changes will be easy enough.
What I am asking, however, is if someone would offer insight into this issue, and possibly point out better places to do the calculations I need to do (shipping calculator must be modified, product_info.php must be modified - as it will detect when an item is in the "no fly" list, and automatically append "SHIPS UPS ONLY" with an appropriate UPS ground shipping icon) - shopping cart and checkout process, as well must be modified to do the same checks.
What I am thinking is to find one appropriate class file (Perhaps I can just write a new class for this, and pop it in the always_include folder, for example? maybe a better location to put it? ) and modify it to include , (this is just an example) - Pseudo-code, if you will..
Basically, modifying the cart, teh checkout, and the shipping calculator, and product info display so that if any product_id is in the cart, or being looked at, that is in the "no fly" list (stored to a separate table with a simple button-push or checkbox via admin panel during an add or edit of product)Code:$validate_shipping = new validate_shipping(); $cart_ships_ups_only = $validate_shipping($cart_array_or_class); if(false !== $cart_ships_ups_only){ if($we_are_in_shipping_calculator){ $shipping_options=strip_disallowed_shipping_from($calculator_results); echo $display_shipping_options_here; } }
It's pretty simple for my case- if a mixed cart happens (I.E. 5 of an item that ship any method, but 1 of a "No-Fly" product in the cart- entire order only ships UPS) , so I dont think it should be too much trouble..
So , what Im wondering is, if anyone has some insight into where would be the best place to put the core functionality (namely, checking cart when calculating shipping, or during checkout, etc) to see if any product in the cart is on the No-Fly list.. , and also, point out, or poke holes into, what I am thinking..
If I am able to get this done and get it working that way, I'll be only too happy to contribute the final solution - which might solve the issue for some other people..


Reply With Quote
