Forums / Built-in Shipping and Payment Modules / Different USPS and UPS Shipping types for perishable vs non-perishable items?

Different USPS and UPS Shipping types for perishable vs non-perishable items?

Views: 2,012

Results 1 to 4 of 4
16 Dec 2014, 4:11 PM
#1
starrysky avatar

starrysky

New Zenner

Join Date:
Aug 2013
Posts:
44
Plugin Contributions:
0

Different USPS and UPS Shipping types for perishable vs non-perishable items?

Hi, I am using ZC version 1.5.1 and php version 5.3. I am having a small problem with the shipping methods. I have a product which is perishable, and so needs to be shipped by priority or express mail or UPS Express only. It has a shipping weight of 2 pounds, and all perishable items are in one category.

This item also will not fit into any of the flat rate boxes, but other products on my site will fit into the flat rate boxes, so I would like to be able to offer that option in the modules/shipping area. When I leave the flat rate boxes as an option in the shipping module area, it always includes flat rate box as a shipping option for this category of items, and I need that to be removed for this one category of items.

Since the items in this master category will not fit into the flat rate boxes, is there a way to disable that particular shipping option for just that master category, and also to disable "standard shipping" and UPS ground for that one category? Thank you

18 Dec 2014, 3:15 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Different USPS and UPS Shipping types for perishable vs non-perishable items?

If you edit your UPS shipping module:
/includes/modules/shipping/ups.php

and add the line in RED:

        if (!in_array($type, $allowed_methods)) continue;
        // EOF: UPS USPS
[B]echo 'UPS $type: ' . $type . '<br>';
[/B]        $cost = preg_replace('/[^0-9.]/', '',  $cost);

then try a shipping quote, what is the $type that shows for the method you want to not show?

Is it:
UPS $type: GND

And when 1 or more of these Products are in the cart, you want USPS to be disabled, correct?

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!]
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!

22 Dec 2014, 4:21 PM
#3
starrysky avatar

starrysky

New Zenner

Join Date:
Aug 2013
Posts:
44
Plugin Contributions:
0

Re: Different USPS and UPS Shipping types for perishable vs non-perishable items?

No, I am sorry if my question was unclear. I want to be able to use both USPS and UPS, but only the priority mail without flat rate boxes. This is because USPS is cheaper than UPS in general, especially when it comes to priority and express.

So, for these products which are all in one master category, I would like to offer only the option for priority mail, express mail, and UPS express or FedEx express, with no ground or flat rate box (the flat rate boxes will not fit the items I am trying to change this for) options included. But there are other items in my store which will fit in the flat rate boxes, and since the flat rate boxes are cheaper than regular priority, I want to offer this option for those other items in my store. Is this what the code you provided will do?

22 Dec 2014, 9:21 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Different USPS and UPS Shipping types for perishable vs non-perishable items?

Edit the file:
/includes/modules/shipping/usps.php

and add the line in RED:

//$show_hiddenCost =  ' $hiddenCost: ' . $hiddenCost;
$show_hiddenCost = '';
[B]echo '$type_rebuilt: ' . $type_rebuilt . '<br>';
[/B]          $methods[] = array('id' => $type_rebuilt,
                             'title' => $title . $show_hiddenCost,
                             'cost' => $cost,
                            );

which ones do you want to keep and which ones do you not want to show for this specific master_categories_id?

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!]
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!