Forums / Bug Reports / [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

[Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

Locked

Views: 2,380

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
10 Jul 2009, 3:45 PM
#1
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

[Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

I have zen-cart 1.3.7 and found a bug with UPS shipping module. We have never been able to get international shipping methods beyond the US and Canada to work. I found out why.

For starters the current UPS shipping module does not offer the WXS shipping method which is Worldwide Express Saver (might add it later?)

When i got it to add that method i found it was showing only $1 shipping charge. The reason is in teh UPS.php module around line 170 the returned cost from UPS is returned as $1,213.87 but as a string and not an int. So when it goes on to do the cost calc of ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes) the multiplication of the number of boxes causes it to reset the value to $1 cause the returned value from UPS is a string (due to the comma for it being over $1,000). I added a preg_replace to remove the , from the returned value and it fixed it but i think this should be looked at and fixed in future releases or maybe it was and i dont have the newest verison.

11 Jul 2009, 5:15 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

You might try using the UPSXML addon. I'm uncertain whether it's compatible with your v1.3.7 though, as I haven't used it.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Jul 2009, 12:08 PM
#3
kamino84 avatar

kamino84

New Zenner

Join Date:
Aug 2006
Posts:
80
Plugin Contributions:
0

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

DrByte:

You might try using the UPSXML addon. I'm uncertain whether it's compatible with your v1.3.7 though, as I haven't used it.

I have used UPSXML before, need to try it on 1.3.7 but shouldnt something like that be fixed on the normal UPS version? I mean im sure shipping prices over $1,000 are not very common but some sites will have them and its a major issue if they are unable to quote proper shipping due to that. Just a suggestion.

18 Jul 2009, 4:13 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

Kamino84:

... in teh UPS.php module around line 170 the returned cost from UPS is returned as $1,213.87 but as a string and not an int. So when it goes on to do the cost calc of ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes) the multiplication of the number of boxes causes it to reset the value to $1 cause the returned value from UPS is a string (due to the comma for it being over $1,000). I added a preg_replace to remove the , from the returned value and it fixed it but i think this should be looked at and fixed in future releases or maybe it was and i dont have the newest verison.This has been fixed in the upcoming v1.3.9 release.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jul 2009, 6:29 PM
#5
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

For those using v1.3.8a, would the UPSXML addon solve this problem?

The learning is in the doing.

Potent Products

18 Jul 2009, 6:45 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

One would have to test it to find out. I haven't.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jul 2009, 6:47 PM
#7
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

Ok, is there something that can be used now with v1.3.8a to correct the situation?

The learning is in the doing.

Potent Products

18 Jul 2009, 6:49 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

What is the URL of the site where you're experiencing the problem?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jul 2009, 7:21 PM
#9
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

Don't have one at this time.

Previous Bug Reports with a [Done vX.XX] in the Title have also provided code or a patch that one could use with v1.3.8a. Having already created a personal v1.3.8a that includes many Security & Bug patches, I wanted to included this fix as well.

If none available at this time, that would be good to know as well.

The learning is in the doing.

Potent Products

20 Jul 2009, 5:48 AM
#10
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

In the ups.php you could change the code from:

        // EOF: UPS USPS
        $methods[] = array('id' => $type,
                           'title' => $this->types[$type],
                           'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);

to read:

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

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!

20 Jul 2009, 11:56 AM
#11
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: [Done v1.3.9] Zen 1.3.7 UPS Shipping Module Version 4674

Thanks Linda.

For those following this thread the patch is applied to:

includes/modules/shipping/ups.php - line #179

The learning is in the doing.

Potent Products