Zen Cart Logo
Forums / Addon Shipping Modules / UPSXML - options by state?

UPSXML - options by state?

Locked

Views: 1,399

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
9 Jun 2009, 2:40 AM
#1
beyerg avatar

beyerg

New Zenner

Join Date:
Oct 2008
Posts:
61
Plugin Contributions:
0

UPSXML - options by state?

Hi,

Been using UPSxml shipping module for months but we've discovered we need to tweak it some. Hope this is possible. We would like to make UPS Ground NOT available for certain destinations.

We ship perishable foods and certain states are too far for the package to get there in time. Most other addresses, ground works just fine and saves the customer money. We've tried telling customers on the site that ground is not an option for certain destinations, but they still choose it....then get mad when we call and tell them it's a no-go.

We need to make sure that ground option doesn't even appear for some states that are ineligible.

So, anyone know how if the module can be modified to exclude UPS Ground by state?

Thanks!

17 Jun 2009, 3:27 AM
#2
beyerg avatar

beyerg

New Zenner

Join Date:
Oct 2008
Posts:
61
Plugin Contributions:
0

Re: UPSXML - options by state?

:blink: No one has had to limit UPS shipping options by destination state?

18 Jun 2009, 6:40 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - options by state?

Are you trying to impose the limitations based on State or State and contents in the cart?

18 Jun 2009, 8:12 PM
#4
beyerg avatar

beyerg

New Zenner

Join Date:
Oct 2008
Posts:
61
Plugin Contributions:
0

Re: UPSXML - options by state?

I want limitations only by state(s)

Thanks for getting back to me.

18 Jun 2009, 9:02 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - options by state?

I just wrote something up the other day for how to test for specific shipping methods on UPS and block them for specific conditions ... now where did I put that ... :unsure:

I will try to find that when I get back later ...

18 Jun 2009, 9:50 PM
#6
beyerg avatar

beyerg

New Zenner

Join Date:
Oct 2008
Posts:
61
Plugin Contributions:
0

Re: UPSXML - options by state?

That would be fabulous. In the meantime, I added a big red (blinking in Firefox) notice on the checkout page that all states West of a certain point cannot use ground.

Buuuut - that's not idiot proof. Certainly an IE user won't notice.....cause it's not blinking :frusty:

'preciate your help!

19 Jun 2009, 3:34 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - options by state?

In the regular UPS shipping module the code can be changed in the function quote to something like:

        if (!in_array($type, $allowed_methods)) continue;

        if ($order->delivery['zone_id'] == 18 && $type == 'GND') {
          // skip quote for GND and Florida
        } else {
          // show quote
        // EOF: UPS USPS
        $methods[] = array('id' => $type,
                           'title' => $this->types[$type] . ' less ground ',
                           'cost' => (($cost - $cost_off) + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
        }
      }

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

You could adapt the code to your shipping module ...

This example uses 18 for Florida ...

1 Mar 2010, 4:44 PM
#8
beyerg avatar

beyerg

New Zenner

Join Date:
Oct 2008
Posts:
61
Plugin Contributions:
0

Re: UPSXML - options by state?

Where do I setup a locality number in the cart?. In my case CA and WA OR are the states I want to exclude from ground.

And would the code for multiple exclude states be expresses comma delimited like:

if ($order->delivery['zone_id'] == 21,22,23 && $type == 'GND')

I found this code, below in the UPS.php, but not in the upsxml.php and not being a coder, trying to "read" it or finding an analogy between the two is tought.

Ajeh:

In the regular UPS shipping module the code can be changed in the function quote to something like:

    if (!in_array($type, $allowed_methods)) continue;

if ($order->delivery['zone_id'] == 18 && $type == 'GND') {
// skip quote for GND and Florida
} else {
// show quote
// EOF: UPS USPS
$methods[] = array('id' => $type,
'title' => $this->types[$type] . ' less ground ',
'cost' => (($cost - $cost_off) + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
}
}

  $this->quotes['methods'] = $methods;
> 
> You could adapt the code to your shipping module ...
> 
> This example uses 18 for Florida ...
1 Mar 2010, 7:02 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: UPSXML - options by state?

If you look in the Locations / Taxes ... Zones ... you can browse for the state you are looking for ...

If you click on it, in the URL you will see the cID this is the zone_id ...

On the IF statement you would us:

        if (in_array($order->delivery['zone_id'], array(21,22,23)) && $type == 'GND') {