Results 1 to 10 of 25

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Free Shipping - some items - some zones - need upgrades

    The ultimate goal is to have just a few products that include Ground shipping. If a customer selects an item that is "free ship", they also have a choice to pay for faster shipping.

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

    Default Re: Free Shipping - some items - some zones - need upgrades

    If you add weight to all Products ... and mark those for Free Shipping to the US as Always Free Shipping ...

    You can make the following customizations ...

    Make a Zone Definition defined for the US Only ...

    Install the Free Shipping Options freeoptions instead of the FREE SHIPPING! freeshipper ... and set the Total >= 0 and set the Zone to the new Zone Definition for the US Only ...

    Edit the code for:
    /includes/modules/shipping/freeoptions.php

    to include the code in RED:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
              $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True') ? true : false);
          }
    
    // bof: Always Free Shipping
          if (!IS_ADMIN_FLAG) {
            global $cart;
    echo 'Always Free: ' . $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') . ' Count: ' .  $_SESSION['cart']->count_contents();
            if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
              $this->enabled = true;
            }
          }
    // eof: Always Free Shipping
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREEOPTIONS_ZONE > 0) ) {
    Edit the code for the UPS shipping module with the code in RED:
    Code:
        // disable only when entire cart is free shipping
    //    if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
    //    }
    Edit the code for the shipping class with the code in RED:
    Code:
      function calculate_boxes_weight_and_tare() {
        global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
    
    // bof: add back Free Shipping
        global $cart;
        $total_weight += $_SESSION['cart']->free_shipping_weight;
    //
        if (is_array($this->modules)) {
    Now the Free Shipping Options freeoptions will only show for the US when the whole order is Always Free Shipping and the UPS will always show with the proper weight ...
    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
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Free Shipping - some items - some zones - need upgrades

    Thank you Oba-san. Let me try this out.

  4. #4
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Free Shipping - some items - some zones - need upgrades

    Ok, I put this up on the testing server and it works well.

    I did have to change this
    PHP Code:
    if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
              
    $this->enabled true;
            } 
    to this
    PHP Code:
    if ($_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
              
    $this->enabled true;
            } else {
    $this->enabled false;} 
    So the problem then became how do we handle a mixed cart. With the above solution, A mixed cart would force the customer to pay shipping on the items that were free ship.

    I came up with a way to handle a mixed cart, Although my method for recalculating the ground shipping "$mycost" was feeble at best, it's was only off by a dollar or so. I'm hoping there is a more accurate way to do it.

    Here is what I did:

    Around line 196, i changed this:
    PHP Code:
    $methods[] = array('id' => $type,        
                               
    'title' => $this->types[$type],
                               
    'cost' => ($cost $shipping_num_boxes ) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' MODULE_SHIPPING_UPS_HANDLING $shipping_num_boxes MODULE_SHIPPING_UPS_HANDLING) ); 
    to this:

    PHP Code:
        if ($type=='GND' && $_SESSION['cart']->free_shipping_weight !=) {
            
            if (
    $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') == $_SESSION['cart']->count_contents()) {
            
                } else {
                
                
    $mycost $cost * (1-($_SESSION['cart']->free_shipping_weight / ($_SESSION['cart']->free_shipping_weight $ups_shipping_weight)));
            
            
    $methods[] = array('id' => $type,        
                               
    'title' => $this->types[$type] . " (Free Shipping + " . (($ups_shipping_weight $shipping_num_boxes) - $_SESSION['cart']->free_shipping_weight) ." lbs.)",
                               
    'cost' => ($mycost $shipping_num_boxes) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' MODULE_SHIPPING_UPS_HANDLING $shipping_num_boxes MODULE_SHIPPING_UPS_HANDLING) );
            }
            
            } else {
                
            
    $methods[] = array('id' => $type,        
                               
    'title' => $this->types[$type],
                               
    'cost' => ($cost $shipping_num_boxes ) + (MODULE_SHIPPING_UPS_HANDLING_METHOD == 'Box' MODULE_SHIPPING_UPS_HANDLING $shipping_num_boxes MODULE_SHIPPING_UPS_HANDLING) );
            } 
    What do you think ?

    Thanks

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

    Default Re: Free Shipping - some items - some zones - need upgrades

    Are you saying ...

    On a cart that is Always Free Shipping ...

    the US only gets:
    Always Free Shipping

    International gets:
    UPS for weight of the Product


    On a cart that is mixed Normal products and Always Free Shipping ...

    the US only gets:
    UPS for the weight of ONLY the Products not marked Always Free Shipping

    International gets:
    UPS for weight of ALL the Products
    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
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Free Shipping - some items - some zones - need upgrades

    Yes, and at the same time, any cart with free ship items, mixed or not will have the ability to upgrade their shipping from Ground at the UPS weight of all the items.

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

    Default Re: Free Shipping - some items - some zones - need upgrades

    Right now, the way the custom code is working is if the cart is Always Free Shipping products only, the US gets:
    Free Shipping Options
    UPS - for ALL Products with weight

    So if you have a Product with the weight of 1.5lbs *and* marked as Always Free Shipping, the US gets the:
    Free Shipping Options
    UPS - for 1.5 lb quote

    Non-US gets:
    UPS - for 1.5 lb quote


    If you have a Mixed cart where 1 Product is weight of 1.5lbs *and* marked as Always Free Shipping and another Product is weight 2lbs and NOT Always Free Shipping the US gets the:
    UPS - for 3.5lb quotes

    Non-US gets:
    UPS - for 3.5lb quotes

    What are you wanting that is different?
    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
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Free Shipping - some items - some zones - need upgrades

    Note: If you're using anything prior to 1.3.9a you will need to correct the class shopping_cart.php as follows around 654:

    // shipping adjustments
    if (($product->fields['product_is_always_free_shipping'] == 1) or ($product->fields['products_virtual'] == 1) or (preg_match('^GIFT', addslashes($product->fields['products_model'])))) {
    $this->free_shipping_item += $qty;
    $this->free_shipping_price += zen_add_tax($products_price, $products_tax) * $qty;
    //$this->free_shipping_weight += ($qty * $products_weight);
    $this->free_shipping_weight += ($qty * $product->fields['products_weight']);
    }

 

 

Similar Threads

  1. 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
  2. Free Shipping on Some items only in some states
    By aarosso in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 11 Nov 2009, 05:00 AM
  3. FREE shipping - not include some items
    By williamL in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 28 Aug 2009, 03:27 PM
  4. Shipping by category, item & zones! Oh, and some free!
    By Ryk in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 May 2008, 09:47 AM
  5. Need some items marked 'order received' some 'shipped'
    By bodini in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 11 Mar 2008, 07:09 AM

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