so, to disable the USPS module on a trigger, i used essentially this:
Put it right below the "types_to_skip_over_certain_value" array setting, within the __construct function. About mid-100s in linecount.Code:if (in_array(1, $_SESSION['cart']->ship_restrict) && $this->usps_countries != "US") $this->enabled = false; if (in_array(2, $_SESSION['cart']->ship_restrict)) $this->enabled = false;
my 'ship_restrict' array is the system I use to track restrictions, and it's added to the cart elsewhere since I use that array in a lot of places on my site. The first line looks for a restriction of '1' and checks the destination country. '1' means that it is an orm-d item and it can only be shipped via ground, and to US addresses. A restriction of '2' means that it needs to go fedex hazmat, and turns off the usps module entirely. Later on, for ajeh's groundonly mod, i use the 'ship_restrict' array instead of the 'in_cart_check' system.
if you're using ajeh's trigger system, use something like this to turn off the module depending on a restriction.
hope that helps, phil!Code:if ($_SESSION['cart']->in_cart_check('products_groundonly','1') && $this->usps_countries != "US") $this->enabled = false; if ($_SESSION['cart']->in_cart_check('products_groundonly','2') $this->enabled = false;


Reply With Quote
