To restrict Products in the USPS shipping module, you can add the code in RED around line 377:
Then add the code in RED around line 700:Code:if (false) { $chk_cart = 0; $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','12'); $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','15'); } // bof: First-Class block $chk_cart = 0; $chk_cart += $_SESSION['cart']->in_cart_check('products_id','112'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','113'); $chk_cart += $_SESSION['cart']->in_cart_check('products_id','114'); // eof: First-Class block // see below use of $chk_cart
Just set the products_id 112, 113 and 114 to match your products_id ...Code:$show_hiddenCost = ''; // bof: First-Class block //echo '$type: ' . $type . ' $chk_cart: ' . $chk_cart . ' preg_match: ' . preg_match('#First\-Class#i', $type) . '<br>'; if ($chk_cart > 0 && preg_match('#First\-Class#i', $type)) { // skip first class } else { $methods[] = array('id' => $type_rebuilt, 'title' => $title . $show_hiddenCost, 'cost' => $cost, ); } // bof: First-Class block } else { //echo 'MISSING! USPS $type: ' . $type . (in_array($type, $this->typeCheckboxesSelected) ? ' YES' : ' NO') . ' $method: ' . $method . ' $usps_shipping_weight: ' . $usps_shipping_weight . ' $minweight: ' . $minweight . ' $maxweight: ' . $maxweight . '<br>'; } } // end for $i to $PackageSize
If you need additional products_id to be used you can copy one of the lines in the first part, if you need less than 3 comment out, from the bottom of the list ...


Reply With Quote
