Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Hide shipping method if order is over a certain weight?

    Is there a way to hide a shipping method of an order is over a certain weight? I am shipping some small items and if they are under a certain weight they can go lettermail which is quite cheap. I am using the table rate for the lettermail since there are a few weight/price levels. The problem is that if their order goes over the max lettermail rate, my alternate shipping option shows, but lettermail is still showing as well, but with a cost of $0.00! Is there some code I can add into my table.php file to hide it if the order is over a certain weight?

    I tried this but no luck:
    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);}

    if ($shipping_weight > "0.5") {
    $this->enabled = false;}
    The bolded part is what I added. I've tried a few variations of it too, but I know I must be missing something significant. There are no errors during checkout with that code added, but it doesn't change anything either, the lettermail cost still shows as $0.00.

    If anyone can point me to what I'm missing in the code I would really appreciate it!

    TIA!

  2. #2
    Join Date
    Jul 2005
    Posts
    114
    Plugin Contributions
    0

    Default Re: Hide shipping method if order is over a certain weight?

    I'm on the same problem, and still I didn't find the answer.

    Dr.Byte kindly gave me this piece of advice :

    global $shipping_weight;
    if ($shipping_weight >= 2) {
    $this->enabled = false;
    }

    Hope it helps

 

 

Similar Threads

  1. Hide shipping method when order exceeds certain weight
    By MortalWombat in forum Built-in Shipping and Payment Modules
    Replies: 30
    Last Post: 7 Apr 2014, 11:25 PM
  2. v151 Offering Free Shipping over a certain amount and under a certain weight
    By jimmie in forum Addon Shipping Modules
    Replies: 0
    Last Post: 17 Aug 2013, 10:58 PM
  3. v138a Hide shipping method when order exceeds certain value of order
    By staudrak in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Jun 2012, 05:22 PM
  4. Disable free shipping over a certain weight
    By jameswilson in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 20 Jul 2009, 07:43 PM
  5. How to Offer Free SHipping over a Certain $$ AND Under Certain Weight
    By Jeff_Mash in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 31 Aug 2007, 06:00 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