Forums / Built-in Shipping and Payment Modules / Enable UPS ground shipping only for International, Alaska, Hawaii.

Enable UPS ground shipping only for International, Alaska, Hawaii.

Views: 2,107

Results 1 to 13 of 13
5 Dec 2015, 10:34 PM
#1
patrick_vincent avatar

patrick_vincent

New Zenner

Join Date:
Jun 2015
Location:
New England
Posts:
29
Plugin Contributions:
0

Enable UPS ground shipping only for International, Alaska, Hawaii.

Hi,

For the sake of ease, I disabled UPS ground shipping altogether for when using table rates (which I mistakenly thought we were using world-wide). Unfortunately the customer wants to use table rates only for the lower 48 which means anything shipped to Alaska, Hawaii or International has to use priority shipping due to me disabling the UPS ground.

Now I'm stuck with a conditional logic issue that will likely require me to change the UPS module (help?).

Like I said, the UPS module option for ground is turned OFF using the ZC admin settings.

If I have to enable the UPS ground, I'll also need to be sure it isn't displayed for the lower 48 due to people selecting it during ordering thinking it might show up faster because it frequent costs more than the table rates (but it won't, we actually eat the some of the cost)

If the order is over $50 (we also have free shipping to the lower 48) I'd also like to keep the UPS ground option from displaying for the same reason (people choose the pay-for option thinking it will be faster...).

If there are any additional questions you have about the situation, I'll be monitoring the thread closely.

Thank you!

7 Dec 2015, 1:30 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Regarding the over $50, what options in lower 48 and outside the lower 48 are you wanting to see at least regarding UPS ground and perhaps related to other options. Not sure I understood the above. (Maybe someone else did?!)

Basic thought process would be, enable UPS from admin, in UPS module at point(s) where it is determined to be enabled/disabled, check the customers ship to location, if in the zone(s) for lower 48 disable the ground shipping option(s) (thinking this would be easier to write than f not in everywhere else), somewhere in that process to also address the $50 which also the question of if that is $50 pre-tax or post... I thought I also remembered an issue of needing to use a decimal when determining that comparison not just 50, but 50.0.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 6:58 PM
#3
patrick_vincent avatar

patrick_vincent

New Zenner

Join Date:
Jun 2015
Location:
New England
Posts:
29
Plugin Contributions:
0

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Logic:

If >$50, offer free shipping and UPS expedited options only (no UPS ground).

If <$50, table rate for lower 48 is shown, UPS ground not shown, UPS expedited is shown.

If International, HI, AK, doesn't matter if <>$50. No table rate or free shipping. Always show all UPS options, ground/expedited.

--

I'm very much thinking that the ground shipping only needs to be displayed based on the three zones, Int, HI, AK. I'm sure code needs to be changed inside the module. I was hoping for a bit of help with that. I don't see a reason to use the $50 mark as a criteria as it would never be displayed in the lower 48, only the other two states and international (but of course, I didn't have the logic spelled out as well as I just did above so perhaps you were thinking of different circumstances).

I currently have the UPS ground option enabled and it is showing across the board.

7 Dec 2015, 7:21 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Well, would take a moment to generate the code to provide the results of the desired conditions, but yeah, looks like need to adjust/touch two shipping modules.

  1. The free shipping should be active only when in lower 48 and product price is >50.
  2. UPS ground deactivated if shipping to lower 48.

The location is zone related. Do you have your zones setup to have/include the lower 48? (I'm trying to login to find the expected designation(s) for that.)

As to the code, I'm not at a computer which makes it a little harder to pull up the associated code, but might be able to get there from another path or two. If nothing else there are others that might be able to jump in now that those details have been provided. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 7:34 PM
#5
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

First of likely multiple posts to address this... From a somewhat dated post by the ever helpful and knowledgeable Ajeh, will want the lower 48 and DC (often forgotten "state") and that there is supposed to be some "tools" at the following link to support this if not already factored/included: http://www.zen-cart.com/content.php?308-prepared-zone-definitions

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 7:50 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Okay a little research and have at least one minimal programming method, can clone the UPS module having one for US and one for rest of world except US, then apply zones as applicable to each... That would minimize all of the ons/offs for the applicable shipping method, but require a little work to do the cloning...

The other is as described/requested to modify the one version of the shipping module to include code either directly or as a listener to modify if ground shipping is on or off based on the zone selected.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 9:03 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Seeing that a previous post related to this, and it has been added to with a link to this thread, and thankfully the code was included (wish I knew that a little while ago, could find in the ups code the first line of below, and then add the code that follows it:```
$allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);if ($order->delivery['zone_id'] == '21') {/* sorry, had wrong format. More to follow */}

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 9:22 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Thiis time, instead find the code that is at the last line below, and add all the code that is before it:

if ($order->delivery['zone_id'] == '21') {
 if($type =='GND' || $type =='GNDCOM' || $type =='GNDRES') continue;
}
if ($type=='STD') {

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Dec 2015, 11:16 PM
#9
patrick_vincent avatar

patrick_vincent

New Zenner

Join Date:
Jun 2015
Location:
New England
Posts:
29
Plugin Contributions:
0

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

The lower 48 zone is set up and working well with both free shipping and table rates. No problems there. Found the SQL statements in an older post and it worked out beautifully.

7 Dec 2015, 11:23 PM
#10
patrick_vincent avatar

patrick_vincent

New Zenner

Join Date:
Jun 2015
Location:
New England
Posts:
29
Plugin Contributions:
0

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Okay. Two mods. One working down and one working up. I think I understand. When I can get to the files I'll test it out.

Thanks!

(And sorry for not linking back to the other post, should have linked both ways. Might as well add it now for reference: https://www.zen-cart.com/showthread.php?218740-Free-Ship-over-50-lower-48-DC-remove-UPS-ground-option-show-as-free ).

7 Dec 2015, 11:34 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

Thanks for addng the link back, I could have done the same, but didn't. Sorry.

Only concern I have about using the clone approach which I didn't fully investigate was the result if one offered a valid shipping option and the other did not, would the guest see two shipping lines where one says sorry we don't ship to you and the other show options. :/

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

10 Dec 2015, 8:08 PM
#12
patrick_vincent avatar

patrick_vincent

New Zenner

Join Date:
Jun 2015
Location:
New England
Posts:
29
Plugin Contributions:
0

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

At first I was thinking that I was to add both sections of code that you added. Is that true? Or am I just adding the second bit of code?

I'm asking because I'm looking closely at the first snippet and it ends without a ; and says "sorry, wrong format, more to follow". Also, the second snippet of codes says, this time instead....

So do I add both segments of code displayed, or just the second one?

10 Dec 2015, 8:56 PM
#13
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Enable UPS ground shipping only for International, Alaska, Hawaii.

I kind of only had a moment to make the modification to the first one to remove it's meat, but glad you asked...

Second was the only one that needed to be applied in regards to this issue. To get the first style to work would require more data accessing and manipulation to accomplish the same result. I didn't do a full step by step review of processing impact, but seemed like it would be a safe way to implement the desired result wthout using more than the built in array value search function. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...