Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Require Additional Shipping Options to Show when Free Shipping is Applied - How?

    *first posted on 24 August 2019 - 166 views - zero replies https://www.zen-cart.com/showthread....*Free-Shipping

    v1.5.5f PHP 7.1

    Objective: have delivery options show in cart shipping estimates and checkout when order total qualifies for free shipping.

    Situation: if I use [admin/modules/order_total/shipping to set free shipping over $65 order value] items that qualify for Free shipping in cart and checkout do not also show the optional 'expedited delivery' which does show for order totals under that limit of $65. I also have 'cloned zone rates' installed and have an optional 'Express Post' (expedited delivery) at an additional cost set up as a clone.

    Detail:

    Because of the above problem I disabled the free shipping in admin/modules/order_total/shipping and in admin/modules/shipping in Zone Rates I have set shipping cost for price up to a set figure ($64.99) and also set shipping at '0' (zero) for price of above $65 to represent free shipping over that amount ... (in the same line in the same zone, e.g. 64.99:3.90,65.00:0.00 )

    Doing this enables the cloned zone rate set up for expedited deliver to show regardless of free shipping or not - so as desired..... however ....

    Problem: shipping over $65 shows as '0' amount which is great BUT the text says 'Zone Rates (The shipping rate cannot be determined at this time)'

    Question: How can I achieve having the text 'order over $65 qualifies free shipping' show instead of the above (as it does if admin/modules/order_total/shipping is used) ? ... or moreover how can I set up shipping, period, to be flexible such that delivery options, expedited or others, can show when order total qualifies for free shipping ??

    Looking forward to some assistance please.

    cheers, Mike

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Require Additional Shipping Options to Show when Free Shipping is Applied - How?

    Maybe I'm missing something, but why not use Flat Rate module for this, with a simple code modification?

    Edit includes/modules/shipping/flat.php and find
    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);
          }
    add after:
    Code:
    if(IS_ADMIN_FLAG !== true && $this->enabled == true) {
              if ($_SESSION['cart']->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
                  $this->enabled = false;
              }
          }
    You can still set the threshold in Modules->Order Total->Shipping (but do NOT enable it), and you can optionally use an existing zone or create a new zone to be used with the Flat Rate module if you want to limit this module to certain countries or whatever...

  3. #3
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Require Additional Shipping Options to Show when Free Shipping is Applied - How?

    Quote Originally Posted by balihr View Post
    Maybe I'm missing something, but why not use Flat Rate module for this, with a simple code modification?

    Edit includes/modules/shipping/flat.php and find
    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);
          }
    add after:
    Code:
    if(IS_ADMIN_FLAG !== true && $this->enabled == true) {
              if ($_SESSION['cart']->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
                  $this->enabled = false;
              }
          }
    You can still set the threshold in Modules->Order Total->Shipping (but do NOT enable it), and you can optionally use an existing zone or create a new zone to be used with the Flat Rate module if you want to limit this module to certain countries or whatever...
    Hi Leonard, thanks for your reply.

    I partially solved 1 minor issue of the text Zone Rates (The shipping rate cannot be determined at this time) by changing the second price to an exaggerated number, e.g. $500 - so instead of 64.99:3.90,65.00:0.00 it reads 64.99:3.90,500.00:0.00.

    In respect to your suggestion which is very useful, the problem is that when I am not having a free shipping promotion I use 'weight' in zone rates to determine shipping cost, I graduate the shipping cost up slightly with each weight increment - I can't really use 'item' or 'price' practically for the items being sold relative to postal envelope weight rate restrictions. I might try to use that same code modification in includes/modules/shipping/zones.php and see how that goes - will let you know how I get on.

    Many thanks for your assistance.

    cheers,
    Mike

  4. #4
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Require Additional Shipping Options to Show when Free Shipping is Applied - How?

    Quote Originally Posted by shags38 View Post
    I partially solved 1 minor issue of the text Zone Rates (The shipping rate cannot be determined at this time) by changing the second price to an exaggerated number, e.g. $500 - so instead of 64.99:3.90,65.00:0.00 it reads 64.99:3.90,500.00:0.00.
    Argh, I didn't quite get it the first time. Yeah, this is how it's done, because the first value is read "up to", it represents the max threshold. Your original setup was like "total up to $64.99 shipping is $3.90, total up to $65.00 is $0". In this case, only the exact $65.00 total gets free shipping. You can change the 500 to 50000 or anything like that, just so you cover the "up to".

    In respect to your suggestion which is very useful, the problem is that when I am not having a free shipping promotion I use 'weight' in zone rates to determine shipping cost, I graduate the shipping cost up slightly with each weight increment - I can't really use 'item' or 'price' practically for the items being sold relative to postal envelope weight rate restrictions. I might try to use that same code modification in includes/modules/shipping/zones.php and see how that goes - will let you know how I get on.
    Now I understand even less. But yeah, the same code modification should work just fine in zones.php file.

    What you could do is add one more line in includes/modules/shipping/zones.php
    Find (around line 266)
    Code:
    $this->quotes = array('id' => $this->code,
    and add BEFORE:
    Code:
    if($shipping_cost == '0.00') $shipping_method = 'Orders over $65 qualifies for free shipping';
    This will add your text about free shipping to the zones module. If you want to have the $65 text dynamic, there's a simple way and a less simple way. Simple would be to set the value in Modules->Order Total->Shipping and change the code above to:
    Code:
    if($shipping_cost == '0.00') $shipping_method = 'Orders over $'.MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER.' qualifies for free shipping';
    The downside is that if you change the threshold in the shipping module, you have to update the order total module as well.
    The less simple way would be to make a few more modifications to the zones.php file so that the threshold is picked up from the module's settings, but I'm not gonna go into that, sorry.

    Hope it helps...

  5. #5
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Require Additional Shipping Options to Show when Free Shipping is Applied - How?

    Quote Originally Posted by balihr View Post
    Argh, I didn't quite get it the first time. Yeah, this is how it's done, because the first value is read "up to", it represents the max threshold. Your original setup was like "total up to $64.99 shipping is $3.90, total up to $65.00 is $0". In this case, only the exact $65.00 total gets free shipping. You can change the 500 to 50000 or anything like that, just so you cover the "up to".


    Now I understand even less. But yeah, the same code modification should work just fine in zones.php file.

    What you could do is add one more line in includes/modules/shipping/zones.php
    Find (around line 266)
    Code:
    $this->quotes = array('id' => $this->code,
    and add BEFORE:
    Code:
    if($shipping_cost == '0.00') $shipping_method = 'Orders over $65 qualifies for free shipping';
    This will add your text about free shipping to the zones module. If you want to have the $65 text dynamic, there's a simple way and a less simple way. Simple would be to set the value in Modules->Order Total->Shipping and change the code above to:
    Code:
    if($shipping_cost == '0.00') $shipping_method = 'Orders over $'.MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER.' qualifies for free shipping';
    The downside is that if you change the threshold in the shipping module, you have to update the order total module as well.
    The less simple way would be to make a few more modifications to the zones.php file so that the threshold is picked up from the module's settings, but I'm not gonna go into that, sorry.

    Hope it helps...
    Once again many thanks Leonard, I appreciate it.

    For the text - whilst playing around with this I went into includes/languages/english/modules/shipping/zones.php and inserted the text as per below;
    Code:
    define('MODULE_SHIPPING_ZONES_TEXT_WAY', '*orders over $65 qualify for <b>Free Standard Shipping</b>');
    it is satisfactory but shows AU at the end of the text - obviously picking that up from the zone being AU - one day I'll find a way to remove it but at present I can live with it.

    It relies on changing this text when the threshold changes or promo expires (LOL - have to have promos full time to get orders these days )

    cheers mate.

 

 

Similar Threads

  1. v151 shipping options when doing free shipping
    By delia in forum Addon Shipping Modules
    Replies: 6
    Last Post: 6 May 2016, 06:01 PM
  2. Disable Ground when offering Free Shipping and alternative shipping options
    By gabe8496 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 8 Aug 2010, 06:41 PM
  3. How to show Free Shipping AND other shipping options?
    By LRS in forum Built-in Shipping and Payment Modules
    Replies: 12
    Last Post: 20 Jul 2010, 08:25 PM
  4. How to hide all other shipping options when an order is eligible for free shipping?
    By shirster in forum Built-in Shipping and Payment Modules
    Replies: 16
    Last Post: 3 Feb 2010, 05:41 AM
  5. COD Fee not applied on Free Shipping Options module
    By Svanis in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 20 Jun 2007, 09:43 AM

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