Post by TheMasterBrewer » Sat Mar 03, 2012 7:27 pm

Is it possible to set a minimum weight for a shipping option/extension? I only want it to be an option for the customer if their order weighs at least 4kg

???

Active Member

Posts

Joined
Mon Oct 17, 2011 8:01 pm


Post by OpenCart Addons » Mon Mar 05, 2012 8:23 am

Add the line:

Code: Select all

if ($this->cart->getWeight() < 4) {
    $status = false;
}
To the beginning checks in your shipping extensions model file.

The file can be found in:
catalog/model/shipping/


Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by Johnathan » Mon Mar 05, 2012 11:14 am

If you need further options beyond this, I have a Restrict Shipping Methods extension that allows you to limit shipping method availability by a variety of options (including weight).

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by TheMasterBrewer » Mon Mar 05, 2012 6:27 pm

Great, thanks guys!

Active Member

Posts

Joined
Mon Oct 17, 2011 8:01 pm

Who is online

Users browsing this forum: No registered users and 1 guest