Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / UPS methods offered vary by zone

UPS methods offered vary by zone

Locked

Views: 1,889

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
15 Jun 2006, 10:01 PM
#1
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

UPS methods offered vary by zone

Hello! I really appreciate the work you all do...Zen Cart keeps getting better and better all the time.

My client uses UPS shipping and would like to allow those in shipping zones who would be more than 3 days ground to not have ground as an option.

I went through and divided up the US, making 2 shipping zones, Shp: UPS1 for the states that are within 3 days UPS shipping ground and Shp: UPS2 for states outside of that.

The UPS module in admin has only one space to indicate the zone and then what shipping methods are available. But I want to say if Shp: UPS1 then allow the following shipping methods (1day, 2day, 3day, and ground) but if Shp: UPS2 then allow the following methods (1day, 2day, 3day).

How would I indicate that in the code? I tried making a duplicate UPS module, but that messed things up. I know there must be a way to just add that statement to the ups.php code, but not exactly sure how.

Thanks in advance for any help!

13 Jul 2006, 6:58 PM
#2
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

Re: UPS methods offered vary by zone

No ideas on this? It has been almost a month and I am still stumped and my client is losing customers and not happy with me.

Thanks!

14 Jul 2006, 5:27 AM
#3
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

Re: UPS methods offered vary by zone

Ok, we thought we came up with the solution, but it didn't work...I was hoping that if we posted what we tried, that perhaps someone could point out where we went wrong.

As mentioned previously, we divided up the US, making 2 shipping zones, Shp: UPS1 for the states that are within 3 days UPS shipping ground and Shp: UPS2 for states outside of that.

In addition to the MODULE_SHIPPING_UPS_TYPES we defined an additional MODULE_SHIPPING_UPS_TYPES_NOGND

then we changed the following line in ups.php:

$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);

to this:

$whereami = $db->Execute("select geo_zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where zone_id = '" . $order->delivery['zone_id']);

if ($whereami['geo_zone_id']=="6") {
$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES_NOGND);
} else {
$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
}

16 Jul 2006, 2:10 AM
#4
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

Re: UPS methods offered vary by zone

I am wondering if this is perhaps posted in the wrong place or if the way I am asking is incorrect...could someone let me know if I should be posting this in a different location or asking the question in a different way?

16 Jul 2006, 2:17 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: UPS methods offered vary by zone

Afraid I don't fully get what you are trying to do ...

If you are trying to zone quotes from UPS ... and you need 3 versions, you need to assure that your naming does not run into conflicts ...

I am not understanding what is really broken ...

What are the filenames you are using?

16 Jul 2006, 3:01 AM
#6
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

Re: UPS methods offered vary by zone

Thank you for replying...it really helps to know which things I said may be confusing so that I can clarify them...I appreciate your letting me know.

I am not trying to get 3 versions...basically, all I am trying to do is to not allow ground shipping for areas in which it would be more than 3 days ground due to the perishable nature of my client's products.

From the admin for the ups shipping set up, you can select a zone and select which shipping methods you will allow. The problem is that I want to have two different zones, one that I allow ground and one in which I don't.

I divided up the states and tried to create 2 zones, one for states that are far enough that they would require over 3 days for ups ground and one for states within the area that ground would be 3 days or less.

Multi-table multi-zone doesn't do the ups quotes, so that is not helpful. It seems like it would be possible for the code I came up with to do the job, but it is not working and I am just not sure where I went wrong.

I am only really using the ups.php file and added in the code that I posted. In the database, I added another MODULE_SHIPPING_UPS_TYPES field and called it MODULE_SHIPPING_UPS_TYPES_NOGND to allow me to define the allowed shipping types for more than one zone. I think where I went wrong is in the second part of the code I listed, in which I am trying to get it to check for the zone id submitted and then match it with the geo_zone id to determine which set up ups shipping types to offer.

Does that make any more sense or am I still not explaining what I mean well enough?

16 Jul 2006, 3:22 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: UPS methods offered vary by zone

If you uninstall all versions of the UPS except one of the new ones you made, does it work for that zone that you configured?

16 Jul 2006, 3:42 AM
#8
visionspin avatar

visionspin

New Zenner

Join Date:
Sep 2004
Location:
Pittsburgh, PA
Posts:
28
Plugin Contributions:
0

Re: UPS methods offered vary by zone

We don't have multiple versions of UPS, just added this one line of code to the standard UPS module that is already in Zen Cart (ups.php):

$whereami = $db->Execute("select geo_zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where zone_id = '" . $order->delivery['zone_id']);

if ($whereami['geo_zone_id']=="6") {
$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES_NOGND);
} else {
$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
}

The shipping works the same as usual...not really broken at all...but it still displays ground as an option to people who are from all over the country.

Here is my basic question...in my code, is my "if" condition valid? I don't know if I am pulling the information out of $whereami correctly.

Thanks!

16 Jul 2006, 4:59 AM
#9
stagebrace avatar

stagebrace

Totally Zenned

Join Date:
Jan 2005
Location:
Tennessee
Posts:
985
Plugin Contributions:
0

Re: UPS methods offered vary by zone

If you intend to allow customers to use the shipping estimator prior to login I dont think this code will work. The estimator allows the customer to enter a zip code and I dont think there is any logic coming back for your if then else statement. I have a feeling you will need to make two trips to ups for each quote. One to get a zone and second to get a quote for the services you want to provide based on the zone. I may be totally off on this so I will continue to think about it.
Dennis