Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default disable shipping module if total is greater than some $ value

    I would like to set up compulsory insurance for orders over $50.

    I have 2 table rate modules; one for standard shipping and the other for insurance shipping. I would like the standard shipping table rate module to be disabled after $50

    The below code disables a shipping mod after 18lbs; I can imagine it can be edited to work with price somehow.

    In includes/modules/shipping/zonetable.php
    Or in
    includes/modules/shipping/any_shipping_mod.php

    Find this code

    PHP Code:
     // disable only when entire cart is free shipping 
        
    if (zen_get_shipping_enabled($this->code)) { 
          
    $this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true false); 
        } 
    DIRECTLY BENEATH IT, add the following:

    PHP Code:
    // Check for Weight and display module if weight exceeds stated value 
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 18) { 
      
    $this->enabled false
    } else { 
      
    $this->enabled true

    So it now looks something like:

    HTML 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);
          }
     
    // Check for Weight and display module if weight exceeds stated value 
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 18) { 
      $this->enabled = false; 
    } else { 
      $this->enabled = true; 
    }  
     
          // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
          $this->num_zones = 3;
        }
     
     

    [FONT=Verdana]* 2 other people have the same unanswered question and would like to answer for them; can see in stickies below[/FONT]

  2. #2
    Join Date
    Jul 2009
    Posts
    22
    Plugin Contributions
    0

    Default Re: disable shipping module if total is greater than some $ value

    I have a similar need. I'd like to be able to disable certain shipping options based on price. (over $100, remove First Class Mail International option)

  3. #3
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: disable shipping module if total is greater than some $ value

    [FONT=Verdana]I gave up and noted in the shipping module language file that it was compulsory over $x[/FONT]

  4. #4
    Join Date
    Jul 2009
    Posts
    22
    Plugin Contributions
    0

    Default Re: disable shipping module if total is greater than some $ value

    OK, I solved my problem. Add a line immediately after this line:
    Code:
    if ($_SESSION['cart']->total > 400 && strstr($services[$i], 'Priority Mail International Flat Rate Envelope')) continue; // skip value > $400 Priority Mail International Flat Rate Envelope
    Here's what I added:
    Code:
    if ($_SESSION['cart']->total > 100 && strstr($services[$i], 'First Class Mail International Package')) continue; // skip value > $100 First Class Mail International Package
    The one that was already there says that if the value is over $400 then Priority Mail International Flat Rate Envelope will no longer be an option.

    Mine is the same, but over $100 First Class Mail International Package is no longer an option.

 

 

Similar Threads

  1. v151 Adding Total Insured Value to fedex shipping module
    By jimmie in forum Addon Shipping Modules
    Replies: 8
    Last Post: 11 Jul 2015, 10:25 PM
  2. v150 No USPS shipping options or estimates if order total greater than $1000
    By spyderrobotics in forum Addon Shipping Modules
    Replies: 14
    Last Post: 5 Oct 2014, 03:42 PM
  3. Exclude shipping method(s) if total is greater than some value.
    By ksolito in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Jun 2009, 07:56 PM
  4. Show qty in stock if greater than 0
    By kbalona in forum Basic Configuration
    Replies: 5
    Last Post: 19 Sep 2008, 10:16 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