I have some products that can only be shipped via UPS. Is there any way to force UPS shipping on an order that has a product which can only be shipped via UPS?
I have some products that can only be shipped via UPS. Is there any way to force UPS shipping on an order that has a product which can only be shipped via UPS?
What shipping modules do you use?
Is there something that identify these Products for only shipping UPS besides the products_id?
About how many of these products do you have for only UPS shipping?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
You could customize the code for:
/includes/modules/shipping/usps.php
and add the code in RED around line 492:
The lines for:Code:// eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart // bof: Skip and only use UPS $chk_cart = 0; $chk_cart += $_SESSION['cart']->in_cart_check('products_id','12'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','15'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','110'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','17'); if ($chk_cart > 0) { // turn off USPS continue; } // eof: Skip and only use UPS // Detect which First-Class type has been quoted, since USPS doesn't consistently return the type in the name of the service
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');
are for the products_id of the Products that can only be shipped UPS and you can add as many as you like ... I used 12, 15, 110 and 17 in my example ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I would like to do the opposite. I have a few products we can ship by USPS. everything else is shipped by UPS. Can I see a sample of the code to accomplish this?
Thanks
What happens if only one product of many is set to ship via USPS? Do all products get sent via UPS? is the purchase stopped? Or do they all get sent via USPS?
The answer to that somewhat changes how the above could be approached.
If the use of USPS is an all or nothing thing, then the above could be used to sum up all of the (few) product that can be sent via USPS, then instead of:
Instead if all product in the cart must be USPS in order to use USPS, then if the sum of the $chk_cart items is not equal to the number of product in the cart or none of the product are to be sent by USPS then need to skip and use only UPS.Code:if ($chk_cart > 0) { continue;
So the if statement would become:
Thus no USPS product, then no USPS, if one or more product can only be sent via UPS then send via USPS, if however, all product in the cart are USPS only then process as a USPS.Code:if ($chk_cart != $_SESSION['cart']->count_contents() || $chk_cart == 0) { continue;
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Thanks. If there are other products in the cart then we would only ship UPS. So the cart can only include products that ship USPS in order for the USPS to be active.
I will give it a try and see if O can get it working
Thanks again
The issue of shipping liquids via USPS has become more problematic over the years. Bottom line if the product is a liquid it is just not safe to ship via USPS legally. Since the fact that it is a liquid, it needs to ship by UPS. At the same time USPS custom codes changes are also problematic since they change regularly. Has anyone come up with an idea how to force liquid products can only be shipped via UPS?
The process, as Ajeh and others hinted at with some potential examples, is to:
1. Determine a way to identify which products require the specialized rule.
2. Inside the relevant shipping modules add some code to enforce the rule (turning themselves on when they can be used, and off when they cannot).
3. Then figure out how you will handle situations where a customer puts multiple products in cart that apply to conflicting rules. (It's way easier to force customers to place separate orders for separate items by blocking checkout if they have a mismatch. Or you could explore multiple shipments: there's an old plugin that does "some" of that, although its purpose is not an exact match to your situation.) Most likely it's best to just force the entire order to go with one carrier or the other, by disabling the module that doesn't apply. Then the customer only sees quotes for sending their entire order via one carrier. Then it's up to them to decide whether to split their purchase into separate orders to see whether they save much/anything on shipping.
That said, I often see forward-thinking merchants simply mark the specific products' prices "up" (perhaps with a one-time charge, perhaps named "shipping surcharge" to explain it) by an amount that on-average covers the specialized shipping requirements (and then when shipping just ship the specialized items via the necessary carrier, and the rest of the order via regular carrier), and let it all average-out in the end, thus making both the cart and the customers' shopping experience simpler. In most cases this is best.
Alternatively, many have said that "Advanced Shipper" by Ceon can do anything. I don't know if it's maintained or current anymore. I've never used it, mostly because it's quite invasive.
Or, you could get into writing heavily customized code to grab quotes from multiple carriers in one order and combine them carefully to offer choices to your shoppers.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
It is maintained. It does not overwrite any core files. Apart from doing almost anything it can get quotes from UPS and Fedex, not that I have ever used them."Advanced Shipper" by Ceon can do anything. I don't know if it's maintained or current anymore. I've never used it, mostly because it's quite invasive.
Steve
github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...
Bookmarks