Forums / Built-in Shipping and Payment Modules / Shipping USPS international?

Shipping USPS international?

Views: 2,365

Results 1 to 13 of 13
12 Feb 2011, 12:53 AM
#1
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Shipping USPS international?

How can I set up the USPS shipping module to allow shipping to Canada? I have Priority International and First Class International listed as checked options, and have no zone defined for USPS. However when I try try to get a shipping quote during checkout it doesn't show USPS for Canadian addresses.

What and where do I need to change settings to make this work?

I'm running 1.3.9g

ETA: I'd also like to add a higher handling fee soley for international customers. I have a $0.75 fee in USPS, is there a way to set up a different fee for int'l customers?

12 Feb 2011, 5:15 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

Check post #26 and make sure that you are using the current USPS January 2, 2011 C version of USPS and have followed the steps:
http://www.zen-cart.com/forum/showthread.php?t=171314&highlight=USPS+January+2011

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!

12 Feb 2011, 5:35 AM
#3
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

That worked, thank you!!

Is there a way to define the handling fee for domestic vs international orders? We'd like to have it $0.75 for domestic orders and $2 handling fee for international. Possible?

12 Feb 2011, 5:37 AM
#4
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

One last shipping question, sorry! In addition to the question above... Is there a way to change the default fo the selected method during checkout? We offer a free shipping option for our foster homes which is always the default since it's cheapest. Is there a way to set it for USPS to be default?

12 Feb 2011, 2:00 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

grace83:

That worked, thank you!!

Is there a way to define the handling fee for domestic vs international orders? We'd like to have it $0.75 for domestic orders and $2 handling fee for international. Possible?

The Handling is managed in the code:

          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

Where you see the MODULE_SHIPPING_USPS_HANDLING you would want to change that based on if the shipping is for National or International ...

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!

12 Feb 2011, 2:01 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

grace83:

One last shipping question, sorry! In addition to the question above... Is there a way to change the default fo the selected method during checkout? We offer a free shipping option for our foster homes which is always the default since it's cheapest. Is there a way to set it for USPS to be default?

What are you using now for the Foster Homes to provide the Free Shipping?

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!

12 Feb 2011, 3:48 PM
#7
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

Right now I have the flat rate module edited to show as a free shipping option saying it's for foster homes. https://www.mainelyratrescue.org/store If you go to checkout and input Maine it should show up for you. We have it set to show for most New England states, I'd just like it so it's not showing as default/bolded when they go to checkout. I'd like USPS cheapest option to be defaulted for "best price".

I'm only slightly familiar with reading code, what would I need it to say? Have that section repeated twice?

12 Feb 2011, 4:40 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

You would need to customize the shipping class where the code sets the default cheapest method:

      $cheapest = false;
      $size = sizeof($rates);
      for ($i=0; $i<$size; $i++) {
        if (is_array($cheapest)) {
          // never quote storepickup as lowest - needs to be configured in shipping module
          if ($rates[$i]['cost'] < $cheapest['cost'] and $rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }
        } else {
          if ($rates[$i]['module'] != 'storepickup') {
            $cheapest = $rates[$i];
          }
        }
      }

You will see how it excludes Store Pickup from being a default ...

NOTE: when testing the default results, you should logout between tests as once set, the selected shipping module can overrule the default based on cheapest ...

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!

12 Feb 2011, 5:13 PM
#9
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

Thank you! I wasn't sure what code to change it to but found an old post of yours writing it. :D You rock!

I'm still not sure how to fix the handling fee. Would this change work for what I need? http://www.zen-cart.com/forum/showpost.php?p=959545&postcount=2

12 Feb 2011, 5:51 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

This line needs to be adjusted:

          if ($order->delivery['country_id'] != STORE_COUNTRY) {

to include the test for US Territories and Islands ...

        if ($order->delivery['country']['id'] == '223' || $this->usps_countries == 'US') {

But try testing it where Puerto Rico is a State of the US and where Puerto Rico is a Country to make sure that works ...

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!

12 Feb 2011, 9:05 PM
#11
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

Ok I think I changed it correctly, but it doesn't look like it's adding the handling fee. I put an item in the shopping cart and did a quote on the cart page before making changes. It showed $11.64. Made the changes and it's still quoting $11.64. Or does the handling fee only get calculated into shipping during checkout?

Here is what I changed the code to:

     $cost = preg_replace('/[^0-9.]/', '',  $cost);
                 if ($order->delivery['country']['id'] == '223' || $this->usps_countries == 'US') {
            $extra_handling_int = 2.00;
          }
          $methods[] = array('id' => $type,
                             'title' => $title,
                             'cost' => ($cost * $shipping_num_boxes) + $extra_handling_int + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );

I have handling set to configure by order not by box, does that make a difference?

12 Feb 2011, 9:14 PM
#12
grace83 avatar

grace83

New Zenner

Join Date:
Sep 2007
Posts:
47
Plugin Contributions:
0

Re: Shipping USPS international?

I changed it back from

if ($order->delivery['country']['id'] == '223' || $this->usps_countries == 'US') {

to

if ($order->delivery['country_id'] != STORE_COUNTRY) {

and it seems to be calculating both domestic and canada handling fees appropriately? Is there a reason I should not leave it that way?

12 Feb 2011, 9:35 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Shipping USPS international?

I miss read what you were trying to do ...

You want it != 223 and not the US so try this and test Puerto Rico as a Country and as a State ... neither should get the charge:

if ($order->delivery['country']['id'] != '223' &&  $this->usps_countries != 'US') {

That tests if the delivery address is the United States and if not, then the charge will be set ...

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!