Forums / Built-in Shipping and Payment Modules / Option to upgrade delivery if under certain weight?

Option to upgrade delivery if under certain weight?

Started by joecooper on 27 Jul 2012, 11:52 AM · Views: 656

Results 1 to 5 of 5
27 Jul 2012, 11:52 AM
#1
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Option to upgrade delivery if under certain weight?

We currently have a flat rate for anything over 1KG of £5.99

Anything under that, we will dispatch using Royal Mail.

How can I add the option for anything under 1KG to be upgraded to a courier?

27 Jul 2012, 12:27 PM
#2
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Option to upgrade delivery if under certain weight?

I have tried to edit table.php and added this to line 62:

if ($_SESSION['cart']->TOTAL_WEIGHT < 1) {
$this->enabled = false;
} 

But this makes the shipping page blank.

using it for total_items works fine.

Any ideas?

1 Aug 2012, 1:00 PM
#3
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Option to upgrade delivery if under certain weight?

bump.

Still unable to find a solution to this problem.

1 Aug 2012, 1:00 PM
#4
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

Re: Option to upgrade delivery if under certain weight?

bump.

Still unable to find a solution to this problem.

1 Aug 2012, 2:02 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Option to upgrade delivery if under certain weight?

See if using $_SESSION['cart']->weight works for you ...

You should be able to use the code in RED for this:

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

      // bof: // disable weight less than 1
      if (!IS_ADMIN_FLAG) {
        if ($_SESSION['cart']->weight < 1) {
          $this->enabled = false;
      }
      // eof: // disable weight less than 1

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {

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!