Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jan 2006
    Location
    Portland, Oregon
    Posts
    276
    Plugin Contributions
    0

    Default Handling fee for USPS International ONLY?

    Hello,
    I'm tearing my hair out with the shipping modules. My cart version details and addons are in my signature. I have FREE SHIPPING! module installed as well as UPS and USPS both working.

    1. I need to add a $5 handling fee ONLY for international USPS shipping rates. This would be for all countries outside the US. I do not want a handling fee for US customers.

    2. I need to add a (Holiday) free shipping option for total orders of $100 or more in the US only.

    3. The only zone I see in the zone dropdowns for my modules is Florida which looks like a default.

    4. I guess I don't understand cloning. Can I clone the USPS shipping module?

    Thanks

    Salvatore

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Handling fee for USPS International ONLY?

    To add a handling fee on just the International Orders in the USPS shipping module, you could customize:
    /includes/modules/shipping/usps.php

    and change the code from:

    to read:
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              if ($order->delivery['country_id'] != STORE_COUNTRY) {
                $extra_handling_int = 7000.00;
              }
    Then add the $extra_handling_int to the cost of the quote:
    Code:
              $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) );
    Just set the amount:
    Code:
                $extra_handling_int = 7000.00;
    to your handling fee for international ...

    For the Holiday Free Shipping Option ... build a Zone Definition for the US Only and add to the Zone Definition Details either all or part of the US to be used ...

    Install the Free Shipping Options freeoptions shipping module and set the Total >= 100.00 and the Zone to the new Zone Definition that you built ...

    After the Holidays, remove the Free Shipping Options freeoptions shipping module ...

    As to Zones, the reason you only see a Zone Definition for Florida is that is what came, by default, with Zen Cart ... you need to create your own Zone Definitions and then add the Details to the Zone Definition that you create ...

    You should not have to clone the USPS shipping module ... but you should save a clean copy and your customized copy for future upgrades ...
    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!

  3. #3
    Join Date
    Jan 2006
    Location
    Portland, Oregon
    Posts
    276
    Plugin Contributions
    0

    Default Re: Handling fee for USPS International ONLY?

    Quote Originally Posted by Ajeh View Post
    To add a handling fee on just the International Orders in the USPS shipping module, you could customize:
    /includes/modules/shipping/usps.php

    and change the code from:

    to read:
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              if ($order->delivery['country_id'] != STORE_COUNTRY) {
                $extra_handling_int = 7000.00;
              }
    Then add the $extra_handling_int to the cost of the quote:
    Code:
              $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) );
    Just set the amount:
    Code:
                $extra_handling_int = 7000.00;
    to your handling fee for international ...

    For the Holiday Free Shipping Option ... build a Zone Definition for the US Only and add to the Zone Definition Details either all or part of the US to be used ...

    Install the Free Shipping Options freeoptions shipping module and set the Total >= 100.00 and the Zone to the new Zone Definition that you built ...

    After the Holidays, remove the Free Shipping Options freeoptions shipping module ...

    As to Zones, the reason you only see a Zone Definition for Florida is that is what came, by default, with Zen Cart ... you need to create your own Zone Definitions and then add the Details to the Zone Definition that you create ...

    You should not have to clone the USPS shipping module ... but you should save a clean copy and your customized copy for future upgrades ...
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              if ($order->delivery['country_id'] != STORE_COUNTRY) {
                $extra_handling_int = 7000.00;
              }
    If I plan on adding this fee to the entire world outside the contiguous US what would the 'country id' be or am I reading this wrong? How am I telling it to select USPS Priority International only?
    I just want to make sure I understand exactly what I am doing here before I make the changes.
    Thanks Linda

  4. #4
    Join Date
    Jan 2006
    Location
    Portland, Oregon
    Posts
    276
    Plugin Contributions
    0

    Default Re: Handling fee for USPS International ONLY?

    Quote Originally Posted by mafiasam View Post
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              if ($order->delivery['country_id'] != STORE_COUNTRY) {
                $extra_handling_int = 7000.00;
              }
    If I plan on adding this fee to the entire world outside the contiguous US what would the 'country id' be or am I reading this wrong? How am I telling it to select USPS Priority International only?
    I just want to make sure I understand exactly what I am doing here before I make the changes.

    Thanks Linda
    Linda

    I see the list of 'country id's. Will I need to add all those ids? And do I add each one separated by a comma? With or without the quotes ('CF','TD','CL','CN')?

    What about the US Territories? Are those considered international for Priority purposes?

    Thanks

    Salvatore

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Handling fee for USPS International ONLY?

    The Country for USPS uses the actual country_id so if the customer has United States as their Country, then their Zone is part of the United States ...

    But when you limit the Country, as in the contiguous US, then you need to make allowances for what is not your idea of the US ...

    To do this, build a Zone for who does NOT get the extra charge ...

    Then find the line:
    Code:
            $methods = array();
    Change that to read (new code in red:
    Code:
    // bof: check for extra charge when not in defined zone 21
          global $db;
          $skip_charge_more_flag = false;
          $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . 21 . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
          while (!$check->EOF) {
            if ($check->fields['zone_id'] < 1) {
              $skip_charge_more_flag = true;
              break;
            } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
              $skip_charge_more_flag = true;
              break;
            }
            $check->MoveNext();
          }
    
          if ($skip_charge_more_flag == false) {
            $extra_handling_int = 7000;
          } else {
            $extra_handling_int = 0.00;
          }
    // eof: check for extra charge when not in defined zone 21
    
            $methods = array();
    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!

  6. #6
    Join Date
    Jan 2006
    Location
    Portland, Oregon
    Posts
    276
    Plugin Contributions
    0

    Default Re: Handling fee for USPS International ONLY?

    I can't seem to get the zones working for me.
    I'll add a zone for the US and it just won't show up in the freeoptions module dropdowns. The Zone Rates shows up on the shopping cart shipping quotes with a message that says it's not available at this time (or something like that) but it also shows a $0.00 amount. It's pre-selected and it looks like customer could choose it for free shipping at all times.
    I don't know why zones won't work.

    However, the initial issue I had with adding a handling fee to International Priority was solved. Your code worked beautifully. I couldn't add a zone so I couldn't configure it for a contiguous states solution but it works fine for now. I'll deal with AK and HI orders as they come along.

    Thanks Linda. Any help on the zones would be appreciated. I'm stumped.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Handling fee for USPS International ONLY?

    What is the Zone ID that you have defined for the contiguous US ...
    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!

  8. #8
    Join Date
    Jan 2006
    Location
    Portland, Oregon
    Posts
    276
    Plugin Contributions
    0

    Default Re: Handling fee for USPS International ONLY?

    Quote Originally Posted by Ajeh View Post
    What is the Zone ID that you have defined for the contiguous US ...
    Well, that's one of my problems. I don't see where I would enter an ID for the zone that I build. And there's nowhere to enter the specific states only countries.
    And I've read the faq/tutorials but they don't seem to correlate with the settings under the zone rates. This has really got me confused.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Handling fee for USPS International ONLY?

    In the code I posted you will see this line:
    Code:
          $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . 21 . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
    where 21 is the Zone Definition used ...

    If you go to the Locations / Taxes ... Zones Definitions ... and click on EDIT on the Zone Definition for your Zone Definition of the US Contiguous States ... what is the zID in the URL?

    If you have not built a Zone Definition for the US Contiguous States you need to do this first, so it can be used for this customization to work ...
    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!

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Handling fee for USPS International ONLY?

    NOTE: if you have not built the Zone yet for the create the Zone for the Lower 48 States plus DC post #8 will help you:
    http://www.zen-cart.com/forum/showth...ight=geo_zones
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How do I charge a Handling Fee for International Orders Only?
    By danielosko in forum Addon Shipping Modules
    Replies: 1
    Last Post: 12 Jun 2015, 12:02 AM
  2. v139h Handling fee for USPS is not being added during checkout
    By canemasters in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 11 Mar 2012, 03:29 PM
  3. Handling Fee for Armed Forces USPS Priority
    By mafiasam in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Dec 2010, 02:13 AM
  4. is there a way to apply handling fee only to international orders?
    By humbll in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 4 Feb 2007, 06:38 PM
  5. USPS Ship - add second handling fee for international orders
    By jmcdog in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 5 Jun 2006, 10:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg