In the original USPS code you you will see:
Code:
$cost = preg_replace('/[^0-9.]/', '', $cost);
// add $this->usps_countries to title to test actual country
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );
// bof: sort by contributed by Marco B
// Sort the options
if (MODULE_SHIPPING_USPS_QUOTE_SORT != 'Unsorted') {
Change to read:
Code:
$cost = preg_replace('/[^0-9.]/', '', $cost);
// bof: skip products when not the only ones in cart
$cart_count = $_SESSION['cart']->count_contents();
$chk_products = 0;
$chk_products += $_SESSION['cart']->in_cart_check('products_id','115');
$chk_products += $_SESSION['cart']->in_cart_check('products_id','168');
//echo '<br>Type: ' . $type . ' Title: ' . $title . ' cost: ' . $cost . ' cart count ' . $cart_count . 'exclude: ' . $chk_products . '<br>';
if ( ( ($chk_products > 0 && $cart_count == $chk_products) && ($type != 'First-Class Mail International Letter**' && $type != 'FIRST CLASS')) || (($chk_products > 0 && $cart_count != $chk_products) && ($type == 'First-Class Mail International Letter**' || $type == 'FIRST CLASS')) || (($chk_products == 0) && ($type == 'First-Class Mail International Letter**' || $type == 'FIRST CLASS')) ) {
// skip it
//echo 'I skipped: ' . $type . '<br>';
} else {
//echo 'I did NOT skipped: ' . $type . '<br>';
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );
}
// eof: skip products when not the only ones in cart
// bof: sort by contributed by Marco B
// Sort the options
if (MODULE_SHIPPING_USPS_QUOTE_SORT != 'Unsorted') {
Test the 3 conditions again, and ensure all is working ...
What is the weight that you are testing on your stickers?
Bookmarks