Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Shipping Weight on Free Shipping Items

    I had a strange item yesterday. I noticed that when an item has free shipping to lets say the Lower 48 States (USA) but a customer is in Alaska, can get the item shipping rate to them calculates a zero weight. so that means that 40lbs can go to Alaska for around $6.00. Anyone else experience this?

    I think it's caused from includes/classes/shopping_cart.php lines#665-670 below:
    PHP Code:
         // adjusted count for free shipping
            
    if ($product->fields['product_is_always_free_shipping'] != and $product->fields['products_virtual'] != 1) {
              
    $products_weight $product->fields['products_weight'];
            } else {
              
    $products_weight 0;
            } 
    once I change it to:
    PHP Code:
         // adjusted count for free shipping
            
    if ($product->fields['product_is_always_free_shipping'] != and $product->fields['products_virtual'] != 1) {
              
    $products_weight $product->fields['products_weight'];
            } else {
              
    $products_weight $product->fields['products_weight'];
            } 
    It worked perfectly, but I think there must be a reason for this.

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

    Default Re: Shipping Weight on Free Shipping Items

    A product marked as Always Free Shipping is for everyone, regardless of the Zone set on the FREE SHIPPING! freeshipper unless you add code to manage that ...

    I just ran through setting up v1.5.3 to have this work for Always Free Shipping to work for 1 Zone and show the other shipping modules at the same time with the following code changes ...

    Edit the file:
    /includes/classes/shipping.php

    and add the code in RED:
    Code:
      function calculate_boxes_weight_and_tare() {
        global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
    
    // bof: allow 1 zone only for Always Free Shipping
    // add zone to FREE SHIPPING! freeshipper
        global $db, $order, $cart;
            $valid_zone_id = 21;
            $check_flag = false;
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $valid_zone_id . "' 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 == false) {
              $total_weight += $_SESSION['cart']->free_shipping_weight;
            }
    // bof: allow 1 zone only for Always Free Shipping
    
        $this->abort_legacy_calculations = FALSE;
        $this->notify('NOTIFY_SHIPPING_MODULE_PRE_CALCULATE_BOXES_AND_TARE');
        if ($this->abort_legacy_calculations) return;
    For UPS shipping, edit the file:
    /includes/modules/shipping/ups.php

    and add the code in RED:
    Code:
        // disable only when entire cart is free shipping
    // bof: disabled for Always Free Shipping 1 zone to always show additional methods
    //    if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
    //    }
    // eof: disabled for Always Free Shipping 1 zone to always show additional methods
    
    Make a Zone for the US 48 State and DC and add it to the FREE SHIPPING! freeshipper shipping module ...

    Make sure that the code for:
    Code:
            $valid_zone_id = 21;
    
    matches the value of your Zone that you added ...
    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
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Shipping Weight on Free Shipping Items

    Couldn't MODULE_SHIPPING_FREESHIPPER_ZONE be used and to then avoid the hard coding of $valid_zone_id = 21; ?
    Am I over thinking this or maybe making this due something it shouldn't?

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

    Default Re: Shipping Weight on Free Shipping Items

    That would actually work quite well and just changing the code to:
    Code:
    $valid_zone_id = MODULE_SHIPPING_FREESHIPPER_ZONE;
    is all that would be needed for that ...
    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!

 

 

Similar Threads

  1. Free Shipping items do not register a weight.
    By 07dcolem in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 21 Dec 2012, 07:34 PM
  2. Shipping Module Programming Question about weight and free shipping
    By voltar in forum Built-in Shipping and Payment Modules
    Replies: 59
    Last Post: 18 Nov 2011, 10:29 PM
  3. Free shipping on order total, problems when some items already have free shipping
    By birdmag in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Nov 2010, 09:18 PM
  4. Enableing free shipping for items based on weight AND total$
    By minou in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 3 Feb 2007, 05:10 PM
  5. Free shipping item weight calculated wrongly for non valid free shipping zone
    By firehorse in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 28 Oct 2006, 05:39 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