Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27
  1. #21
    Join Date
    Dec 2010
    Posts
    128
    Plugin Contributions
    0

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    Quote Originally Posted by Ajeh View Post
    Have you a link to that add on? I am not following how a clone of Flat Rate flat is calculating shipping regarding weight ...
    http://www.zen-cart.com/downloads.php?do=file&id=1224

    It doesn't actually calculate shipping... that's the point of the add-on... I calculate the shipping manually, email the customer the shipping quote, then they enter what I tell them themselves in the text entry box that this add-on creates.

  2. #22
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,170
    Plugin Contributions
    6

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    What version of Zen Cart are you using?

    What is the Zone Definition for the USA set to on the id?
    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.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #23
    Join Date
    Dec 2010
    Posts
    128
    Plugin Contributions
    0

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    Quote Originally Posted by Ajeh View Post
    What version of Zen Cart are you using?

    What is the Zone Definition for the USA set to on the id?
    1.39h....

    I'm not quite sure what you are asking for regarding the zone definition..... When I click Admin > Locations/Taxes > Zone Definitions > USA >

    It says: Country: United States Zone: All Zones

  4. #24
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,170
    Plugin Contributions
    6

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    If you look at the URL ... what is the zID for that Zone Definition that you see in the URL?
    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.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #25
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,170
    Plugin Contributions
    6

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    Once you know the Zone Definition id number, you can replace the 21 that I use with your value ...

    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;
    
    // Always Free Shipping added back except for US 48 plus DC zone_id = 21
    // bof: allow 1 zone only for Always Free Shipping
        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;
            }
    // eof: allow 1 zone only for Always Free Shipping
    // Always Free Shipping added back except for US 48 plus DC zone_id = 21
    
        if (is_array($this->modules)) {
    Then customize your Flat Rate flat clone ...

    I am using the Flat Rate flat module so just adapt the code to your Flat Rate clone 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_FLAT_STATUS == 'True') ? true : false);
    //      }
    Code:
    // class methods
        function quote($method = '') {
          global $order;
    
    global $shipping_weight;
    //echo 'Flat $shipping_weight: ' . $shipping_weight . ' $total_weight: ' . $total_weight . '<br>';
    if ($shipping_weight > 0) {
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                         'cost' => MODULE_SHIPPING_FLAT_COST + $chk_weight_charge)));
    }
    
          if ($this->tax_class > 0) {
    On the FREE SHIPPING! freeshipper add your Zone for the US to that module ...

    See if this makes it work for you ...
    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.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  6. #26
    Join Date
    Dec 2010
    Posts
    128
    Plugin Contributions
    0

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    Quote Originally Posted by Ajeh View Post
    Once you know the Zone Definition id number, you can replace the 21 that I use with your value ...

    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;
    
    // Always Free Shipping added back except for US 48 plus DC zone_id = 21
    // bof: allow 1 zone only for Always Free Shipping
        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;
            }
    // eof: allow 1 zone only for Always Free Shipping
    // Always Free Shipping added back except for US 48 plus DC zone_id = 21
    
        if (is_array($this->modules)) {
    Then customize your Flat Rate flat clone ...

    I am using the Flat Rate flat module so just adapt the code to your Flat Rate clone 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_FLAT_STATUS == 'True') ? true : false);
    //      }
    Code:
    // class methods
        function quote($method = '') {
          global $order;
    
    global $shipping_weight;
    //echo 'Flat $shipping_weight: ' . $shipping_weight . ' $total_weight: ' . $total_weight . '<br>';
    if ($shipping_weight > 0) {
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                         'cost' => MODULE_SHIPPING_FLAT_COST + $chk_weight_charge)));
    }
    
          if ($this->tax_class > 0) {
    On the FREE SHIPPING! freeshipper add your Zone for the US to that module ...

    See if this makes it work for you ...
    Linda,

    Thanks so much for your help and time. I got it working perfectly now so that ALWAYS FREE SHIPPING products do not offer the free shipping option for zones outside the USA. This solution worked for me. THANK YOU!

  7. #27
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,170
    Plugin Contributions
    6

    Default Re: Calculated shipping doesn't show up when an item is free shipping.

    Thanks for the update that this is working for you to offer Always Free Shipping to just one zone ...
    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.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Show Item is FREE shipping in the CART.
    By gloerick in forum General Questions
    Replies: 42
    Last Post: 14 Mar 2011, 02:25 PM
  2. Replies: 2
    Last Post: 12 Mar 2011, 02:40 PM
  3. Per Weight Shipping not Calculated when Tax is Calculated
    By CascianoLtd in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Sep 2009, 04:29 AM
  4. Free Shipping when order >$XX - Table Rate, Both Show
    By gcampos in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Jun 2007, 06:28 AM
  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

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
  •