Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Zone Rates: maximum shipping weight exceeded

    I am using 3 zone based shipping methods:

    Method 1: zones - Registered Air Mail for international orders only (sort order 6 in admin)
    Method 2: zones2 (clone of zones) - Express Post for domestic orders only (sort order 8)
    Method 3: zones3 (another clone of zones) - Express Courier International (sort order 3)


    Method 1 allows for a maximum weight of 2kg whereas Method 3 allows for up to 5kg.

    Frequently I get international orders over 2kg.

    When the customers get to the checkout shipping page they see the 3 methods. The domestic option is disabled - as it should be.

    screenshot here

    Regardless of the weight in the cart the radio button for method 1 (Registered Air Mail) is pre-selected. This is not desirable if the weight in the cart exceeds 2kg. In this case method 1 should be disabled and the radio button should be pre-selected for method 3 (Express Courier International) being the only method available to customer.

    How can this be achieved?

    Thanks / Frank
    Last edited by frank18; 3 Oct 2012 at 10:57 AM.

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Zone Rates: maximum shipping weight exceeded

    Tried this (tested on local install) and it seems to work:

    In the file /includes/modules/shipping/zones.php

    changed line 278 from


    if (strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) {
    to this


    if ((strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) || ($shipping == -1)) {

    If the weight exceeds 2kg, method 1 (zones - Registered Air Mail for international orders only) is not displayed at all. This is true for the shipping estimator as well as for the checkout_shipping page. Only method 3 (Express Courier International) is available.

    I have not completed a full checkout cycle as yet and would like to see an opinion from an experienced coder before I upload the file to the live server.

    Thanks again

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

    Default Re: Zone Rates: maximum shipping weight exceeded

    Do you have a Zone setup for the:
    Registered Air Mail for international orders only

    If so, you could test for the weight of the order and if over the 2, then turn off the module ...
    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!

  4. #4
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Zone Rates: maximum shipping weight exceeded

    Thanks Ajeh

    Quote Originally Posted by Ajeh View Post
    Do you have a Zone setup for the:
    Registered Air Mail for international orders only
    Yes, this method is skipped for domestic orders (Skip Countries =AU)

    If so, you could test for the weight of the order and if over the 2, then turn off the module ...
    I am having a mental blank - sorry: Which file needs to be modified?

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

    Default Re: Zone Rates: maximum shipping weight exceeded

    Edit that file and add the code in RED:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
          }
    
          global $shipping_weight;
          if ($shipping_weight > 2) {
            $this->enabled = false;
          }
    
    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!

  6. #6
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Zone Rates: maximum shipping weight exceeded

    Quote Originally Posted by Ajeh View Post
    Edit that file and add the code in RED:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
          }
    
          global $shipping_weight;
          if ($shipping_weight > 2) {
            $this->enabled = false;
          }
    
    Thanks - did that and the method is disabled on the shopping cart page.

    Also tested this in another browser with clean cache - same result.

    BUT ... it still still shows up on checkout_shipping page with radio button selected and rate =$0.00

    Tested this on live install with shipping address USA.
    Last edited by frank18; 7 Oct 2012 at 05:12 AM.

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

    Default Re: Zone Rates: maximum shipping weight exceeded

    You are using 3 clones of zones.php correct?
    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!

  8. #8
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Zone Rates: maximum shipping weight exceeded

    Quote Originally Posted by Ajeh View Post
    You are using 3 clones of zones.php correct?
    correct

    EDIT: nope, zones.php does the Registered Air Mail, zones2.php does domestic express Post and zones3.php does Express Courier International

    I edited the zones.php file ..
    Last edited by frank18; 7 Oct 2012 at 05:15 AM.

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

    Default Re: Zone Rates: maximum shipping weight exceeded

    My bad ...

    Use the code:
    Code:
          global $total_weight;
          if ($total_weight > 2) {
            $this->enabled = false;
          }
    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!

  10. #10
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Zone Rates: maximum shipping weight exceeded

    Quote Originally Posted by Ajeh View Post
    You are using 3 clones of zones.php correct?
    You can test this with a USA address on the second link in my sig and play with a heavy product Blackmores / Duo Celloids / C.P.M.P. 170 tabs -- 8 units is under 2kg and 9 units is just over 2kg

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 Zone Rates - calculate shipping by total weight not per product
    By mattys in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 30 Jul 2012, 02:52 PM
  2. zone rates configuring by price and not weight
    By giftsandwhatnot in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 19 Aug 2011, 08:28 PM
  3. Multiple Shipping rates depending on zone and weight
    By buffy in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 18 Dec 2009, 03:08 PM
  4. Mixing Per Weight Unit and Zone Table Rates
    By thomasharding in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 2 Sep 2009, 10:07 PM
  5. Zone Rates Problem with weight lbs to kgs
    By bookwise in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 11 Mar 2009, 04:38 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