
Originally Posted by
mcqueeneycoins
Thanks, lat9--basically I have 3 or 4 different tax classes, one of which is for supplies. The way I have it set up now is the flat-rate option is available for all products except tax class id 4, which works just fine. It then displays only the USPS module with ground advantage and priority mail options when tax class id 4 is present in the cart.
But, if the cart has no supplies (no products with tax id 4), it displays flat rate, ground advantage and priority mail. I basically need ground advantage to be disabled in this case and only display flat rate and priority.
THanks!
Thanks for the clarification! You can use the following code in that auto-loaded observer:
Code:
case 'NOTIFY_USPS_UPDATE_OR_DISALLOW_TYPE':
// -----
// Disallow "Ground Advantage" if there are no products with a tax_class_id of 4
// in the cart.
//
if (stripos($p1, 'USPS Ground Advantage') !== false) {
if ($_SESSION['cart']->in_cart_check('products_tax_class_id', '4') == 0) {
$p2 = false;
}
}
break;