Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default US and rest of the world shipping configuration

    Hi

    I need to set up shipping for a US based business for which I have configured the "table rate" for US shipping prices, and need to set for the international (rest of the world) shipping, I downloaded "USPS K8" module to get the quotes for that.

    I also need to set free shipping for orders over a given amount, for which I configured the "free shipping options".

    I'd need to keep the table rate for US, and use the USPS for the international, and I am not sure I understand how to best deal with it.

    The packages are small in size, and weight (items are scarves).

    Please advise me on the best approach so that US customers have the "table rate", and the rest of the world gets the "USPS" quotes, and both will benefit from "free shipping".

    Thank you

  2. #2
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: US and rest of the world shipping configuration

    So because the described criteria is purely destination based and or total value of purchase based, this becomes a relatively easy series of logic....

    The logic is applied typically at the onset of the applicable shipping code.

    Table rate enabled: if admin enabled, destination is US (zone) and below your price threshold (could be unique for US shipments, but if not consistent for US and international will complicate the free shipping part). All other conditions, disabled.
    USPS: if admin enabled, destination is outside US (zone based) and below price threshold (could be unique for international, but will complicate the free shipping part). All other conditions, disabled.
    Free shipping: if price regardless of destination, then enabled if enabled in admin and total price is at or above the price threshold. If individual for US and international, then enabled if enabled in admin and either of the following, US destination and price at or above US threshold or international destination and price is at or above international price...

    This method would eliminate the ability to pick between free shipping or the applicable shipping method for the destination...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: US and rest of the world shipping configuration

    Thank you.

    I know my English comprehension is causing me some difficulties ... so please bare with me.

    What do you mean by " if admin enabled" and "then enabled if enabled in admin"?

    Let me say what I have done so far:

    Set 3 zones in
    locations/taxes > zone definitions
    -- California:
    --------- country: USA - zone: California
    -- USA:
    --------- country: USA - zone: All zones
    -- International:
    --------- country: All countries - zone: All zones

    Set tax rates
    locations/taxes > tax rates
    -- California:
    --------- priority: 0 - zone: California - tax rate: 8.5%
    -- USA:
    --------- priority: 0 - zone: USA - tax rate: 0%
    -- International:
    --------- priority: 0 - zone: International - tax rate: 0%

    Set shipping
    modules > shipping > table rate [the circle is yellow] obviously I don't know what setting to correct.
    -- shipping table: 1:5.00,4:8.00,5:10.00,10000:9%
    -- table method: item
    -- handlung fee: 0
    -- handling per: order
    -- tax class: none
    -- tax basis: shipping
    -- shipping zone: USA
    -- sort order: 0

    modules > shipping > free shipping options
    -- enable Free Options Shipping: true
    -- shipping Cost: 0
    -- handling Fee: 0
    -- total >=: 100
    -- total <=:
    -- weight >=:
    -- weight <=
    -- item count >=
    -- item count <=
    -- tax class: none
    -- tax basis: shipping
    -- shipping zone: none
    -- sort order: 0

    modules > shipping > USPS
    Have not configure anything yet (still in local), and the default settings are in place, I guess I'd need to configure only the international rates only?

  4. #4
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: US and rest of the world shipping configuration

    Quote Originally Posted by keneso View Post
    Thank you.

    I know my English comprehension is causing me some difficulties ... so please bare with me.

    What do you mean by " if admin enabled" and "then enabled if enabled in admin"?



    modules > shipping > free shipping options
    -- enable Free Options Shipping: true
    -- shipping Cost: 0
    -- handling Fee: 0
    -- total >=: 100
    -- total <=:
    -- weight >=:
    -- weight <=
    -- item count >=
    -- item count <=
    -- tax class: none
    -- tax basis: shipping
    -- shipping zone: none
    -- sort order: 0

    modules > shipping > USPS
    Have not configure anything yet (still in local), and the default settings are in place, I guess I'd need to configure only the international rates only?
    To address just the few things above...

    If admin enabled or if enabled in admin are the same thing... Notice above that for free shipping options, the first line is: enable Free Options Shipping. The constant that is set there represents whether the option is enabled in admin or not. (Ie. if you are in your admin panel and disabled free shipping, would you want a customer to be offered free shipping?) I would think the answer would be no. :)

    The "words" (sometimes also called pseudo-code) identify the criteria that would be needed to be met and "translated" to computer code.
    For the above free shipping, it is set to show when the total is >= 100 regardless of the destination. Basically that portion of the code takes care of itself and will be offered to the customer if the criteria is met of the total price equaling or exceeding the entry of 100 regardless of the destination zone.

    As for USPS, yes if that "clone" will only be used for international purposes, then basically the code takes care of itself to not process through the US shipping (don't forget to consider what you define as US, because there are territories and other destinations that *are* part of the US, but not part of say the lower continental 48 states, or the 50 united states, etc...) and will only need to be setup for the international part.

    Now as far as "specific" code... In ZC 1.5.4, the flat rate shipper code is in part:

    Code:
    // class constructor 
         function flat() { 
           global $order, $db; 
      
           $this->code = 'flat'; 
           $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE; 
           $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION; 
           $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER; 
           $this->icon = ''; 
           $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS; 
           $this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS; 
      
           // disable only when entire cart is free shipping 
           if (zen_get_shipping_enabled($this->code)) { 
             $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false); 
           } 
      
           if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) { 
             $check_flag = false; 
             $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); 
             while (!$check->EOF) { 
               if ($check->fields['zone_id'] < 1) { 
                 $check_flag = true; 
                 break; 
               } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) { 
                 $check_flag = true; 
                 break; 
               } 
               $check->MoveNext(); 
             }
    
             if ($check_flag && $_SESSION['cart']->show_total() >= '100') { // This could be written to support the way the free shipper code is written so that as free shipper is modified, so is this section...
               $check_flag = false;
             }
      
    
             /* // ie: Below is a portion of the free shipping options code for the total price of the cart.  It deactivates this method of shipping if the current method has been identified as possible to be active and if the free shipping method is active.
             if($check_flag) {
              switch (true) { 
               case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')): 
     // free shipping total should not need adjusting 
     //            if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) { 
                 if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) { 
                   $check_flag = false; 
                 } 
                 break; 
               case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')): 
     //            if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) { 
                 if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) { 
                   $check_flag = false; 
                 } 
                 break; 
               case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')): 
    //            if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) { 
                 if (($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) { 
                   $check_flag = false; 
                 } 
                 break; 
               } 
             } 
           
    
             */
             if ($check_flag == false) { 
               $this->enabled = false; 
             } 
           } 
         }
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: US and rest of the world shipping configuration

    Quote Originally Posted by mc12345678 View Post
    (Ie. if you are in your admin panel and disabled free shipping, would you want a customer to be offered free shipping?) I would think the answer would be no. :)
    ;)
    Yes I got that part some time back.

    What confused me, and now I think I am understanding is you were suggesting to do some coding, and put in plain text what the reasoning (logic) to follow, right?

    If above is correct no wonder I had hard time, at least I do understand some English as opposed to coding!

    So please see if I got it correctly:
    the settings I have are fine (save the USPS that need to be set for international), and I need to add the code you supplied to modules/shipping/flat.php

    If above is correct I then have a few questions:

    Shall I add the code to the flat.php file, thus I need to enable the "flat rate" module instead of "table rate" module?
    Or was it an overlook and I should add it to the modules/shipping/table.php
    If it was an overlook where in table.php I need to add the code?

    Either case, do I need to uncomment the commented part of code (blu in your previous post), and use both the red, and blue part of the code?

    In the red part of code is the number 100 the value I put in the "free shipping options" setting in admin, to be more clear, if I change that value in the admin, I need to change it in the code as well, right?

    Notice the if if, I am learning
    Last edited by keneso; 20 Jan 2016 at 06:49 PM.

  6. #6
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: US and rest of the world shipping configuration

    I may have misunderstood something, but....

    Is table rate working for you? If yes, do nothing
    Is free shipping options for orders over $xxx USA only, International only or everyone. set zone appropropriately.
    Is USPS for International only, If yes, set zone to International and configure the International classes you wish to offer.

    If i missed something, just ignore my comments above.
    Note: Freeshipping is not the same as FreeShippingOptions
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  7. #7
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: US and rest of the world shipping configuration

    Quote Originally Posted by RixStix View Post
    I may have misunderstood something, but....
    Thank you.

    I don't think you misunderstood, I did a couple tests (need to do some more) with the settings I have, and seems to behave as I need.

    Do you have any idea about why the yellow dot on "table rate" what setting am I doing wrong?

  8. #8
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: US and rest of the world shipping configuration

    Quote Originally Posted by keneso View Post
    Thank you.

    I don't think you misunderstood, I did a couple tests (need to do some more) with the settings I have, and seems to behave as I need.

    Do you have any idea about why the yellow dot on "table rate" what setting am I doing wrong?

    The yellow comes from this line in admin/modules.php:

    Code:
                          echo '&nbsp;' . ((!empty($module->enabled) && is_numeric($module->sort_order)) ? zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') : ((empty($module->enabled) && is_numeric($module->sort_order)) ? zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') : zen_image(DIR_WS_IMAGES . 'icon_status_red.gif'))); 
    244
    Which effectively indicates that the enabled status of the module evaluates to a false condition ($module->enabled doesn't exist or equals false) and that the sort order is non-numeric (in your case 0)...

    I believe the "solution" to the yellow is to make the sort order non-zero, but if I remember correctly in ZC 1.5.4 and below if a shipping module's sort order is non-zero, then all need to be non-zero and also unique (not the same for all of them). If correct, this condition is resolved in ZC 1.5.5 allowing all to be zero or all to be the same value. I could be thinking about payment modules though...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: US and rest of the world shipping configuration

    Quote Originally Posted by mc12345678 View Post
    The yellow comes from this line in admin/modules.php:

    Which effectively indicates that the enabled status of the module evaluates to a false condition ($module->enabled doesn't exist or equals false) and that the sort order is non-numeric (in your case 0)...

    I believe the "solution" to the yellow is to make the sort order non-zero
    Thank you.

    You are killing me with all the extra info (code), please don't get me wrong I appreciate, as I do learn (try to) from every bit of extra info, it's just my head that is limited!

    I changed the 0 to 1, but didn't turn green.

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

    Default Re: US and rest of the world shipping configuration

    You are seeing the yellow icon because you have a Zone set ...

    A Shipping module will show as Yellow when either:
    A module is installed but NOT enabled in the Admin
    A valid Zone is set
    Last edited by Ajeh; 20 Jan 2016 at 09:17 PM.
    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: v1.5.5]
    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 3 123 LastLast

Similar Threads

  1. v151 Free shipping for Australia and rest of the World charge Shipping w/AU post
    By oavs in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 27 Jan 2014, 02:38 PM
  2. Desperate ::How to ship AU& NZ one fee and rest of the world another shipping fee
    By oavs in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 16 Nov 2008, 02:48 PM
  3. GB free shipping rest of the world £1.50
    By snarfy in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 19 Jun 2008, 06:05 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR