Forums / Built-in Shipping and Payment Modules / Disable UPS Ground for some states?

Disable UPS Ground for some states?

Views: 1,131

Results 1 to 4 of 4
17 Nov 2011, 7:15 PM
#1
brushwoodnursery avatar

brushwoodnursery

Zen Follower

Join Date:
Dec 2006
Posts:
199
Plugin Contributions:
0

Disable UPS Ground for some states?

Is there a way to disable UPS Ground to 8 states and only allow them the option of Priority Mail or UPS 3 Day Select? (shipping live plants)

18 Nov 2011, 2:37 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Disable UPS Ground for some states?

To turn off the display of Ground shipping in the UPS shipping module for specific states, you could change the code from:

        $cost = preg_replace('/[^0-9.]/', '',  $cost);
        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) );
      }

      $this->quotes['methods'] = $methods;

to read:

        $cost = preg_replace('/[^0-9.]/', '',  $cost);

// bof: Disable Ground for specific states
//echo 'UPS TYPE ' . $type . '<br>';
        if (in_array(strtoupper($order->delivery['state']), array('OHIO', 'NEW YORK') ) && $type == 'GND') {
          // skip display
        } else {
          $methods[] = array('id' => $type,
                             'title' => $this->types[$type],
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_UPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_UPS_HANDLING) );
        }
// eof: Disable Ground for specific states

      }

      $this->quotes['methods'] = $methods;

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!

19 Nov 2011, 4:27 PM
#3
brushwoodnursery avatar

brushwoodnursery

Zen Follower

Join Date:
Dec 2006
Posts:
199
Plugin Contributions:
0

Re: Disable UPS Ground for some states?

Thank you very much!

19 Nov 2011, 4:48 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Disable UPS Ground for some states?

You are most welcome ... glad that this is working for you ... :smile:

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!