Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Built-in Shipping and Payment Modules / Deactivate shipping table mod when weight > 100lbs

Deactivate shipping table mod when weight > 100lbs

Locked

Started by pawelsad on 30 Sep 2006, 5:52 PM · Views: 1,735

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
30 Sep 2006, 5:52 PM
#1
pawelsad avatar

pawelsad

New Zenner

Join Date:
Jan 2005
Posts:
38
Plugin Contributions:
0

Deactivate shipping table mod when weight > 100lbs

Hi everyone :)

I have a small problem with shipping module

I have to deactivate table shipping module when order weight is more then 100 lbs

less then 100 lbs table module working and gives client shipping option
more then 100 lbs table module its deactivated to the client

If anyone know how to do it please help .

Pawel

30 Sep 2006, 6:00 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Deactivate shipping table mod when weight > 100lbs

You could make a function similar to the function zen_get_shipping_enabled

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

The function for the Admin returns true so that it is always enabled ... and the function for the Catalog checks the weight in the cart ...

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!

30 Sep 2006, 6:59 PM
#3
pawelsad avatar

pawelsad

New Zenner

Join Date:
Jan 2005
Posts:
38
Plugin Contributions:
0

Re: Deactivate shipping table mod when weight > 100lbs

I added that code :

   if ($_SESSION['cart']->show_weight()>100) { 
      $this->enabled = false; 
    }  

under

 if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

and in the store everything its working but i have the problem in the admin>modules>shipping

Fatal error: Call to a member function on a non-object in /home/tropic1/public_html/includes/modules/shipping/table.php on line 64

:):)

30 Sep 2006, 7:51 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Deactivate shipping table mod when weight > 100lbs

Try this, assuming you're using v1.3.x:

if (IS_ADMIN_FLAG !== true && $_SESSION['cart']->show_weight()>100) { 
      $this->enabled = false; 
    }  

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

30 Sep 2006, 8:17 PM
#5
pawelsad avatar

pawelsad

New Zenner

Join Date:
Jan 2005
Posts:
38
Plugin Contributions:
0

Re: Deactivate shipping table mod when weight > 100lbs

Yeah its working thank you very much :) im runing 1.3.5 :)

Pawel

4 Jan 2007, 12:56 PM
#6
dudeshouse avatar

dudeshouse

New Zenner

Join Date:
Dec 2005
Location:
Portishead, UK
Posts:
32
Plugin Contributions:
0

Re: Deactivate shipping table mod when weight > 100lbs

Is there any way of doing this using overrides? I'm very conscious of the difficulty in upgrading when overwriting files... In fact, I'm trying NOT to change any core files if at all possible.
Any help would be greatly appreciated.
Thanks,
Glenn

...there is nothing worse than aggresive stupidity...

4 Jan 2007, 2:28 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Deactivate shipping table mod when weight > 100lbs

The Modules for Payment, Shipping and Order Totals only utilize overrides for the text, not for the code ...

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!

4 Jan 2007, 3:10 PM
#8
dudeshouse avatar

dudeshouse

New Zenner

Join Date:
Dec 2005
Location:
Portishead, UK
Posts:
32
Plugin Contributions:
0

Re: Deactivate shipping table mod when weight > 100lbs

Ajeh:

The Modules for Payment, Shipping and Order Totals only utilize overrides for the text, not for the code ...

That's what I thought, Thanks for clearing that up...

...there is nothing worse than aggresive stupidity...