Post by jmagro » Fri Jan 30, 2015 5:32 am

I found a solution where weight based shipping only shows up when the cart exceeds 150 lbs.
(http://forum.opencart.com/viewtopic.php ... 17#p499775)

Can I do something similar to disable the UPS option when the cart exceeds 150 lbs. I'm not very well versed in php or other scripting languages unless we're talking copy and paste. (I'm a copy/paste master :P )

So ideally, UPS would disappear as an option and weight based shipping would kick in. Thanks in advance. Love the 2.x upgrade.

New member

Posts

Joined
Thu May 12, 2011 3:31 am

Post by Johnathan » Fri Jan 30, 2015 5:38 am

Restrict Shipping Methods can do this without requiring you to edit files, but if you want to hard-code the weight in, something like this should work:

Code: Select all

IN:
/catalog/model/shipping/ups.php

AFTER:
$weight = $this->weight->convert($this->cart->getWeight(), $this->config->get('config_weight_class_id'), $this->config->get('ups_weight_class_id'));

ADD:
if ($weight >= 150) return; 

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by jmagro » Fri Jan 30, 2015 5:45 am

Perfect. You rock, Johnathan! Thanks for responding so quickly.

New member

Posts

Joined
Thu May 12, 2011 3:31 am
Who is online

Users browsing this forum: No registered users and 6 guests