Thanks a million! Works a charm!
Thanks a million! Works a charm!
Thanks for the update that this customized code works for you ... remember us when you are rich and famous ...![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I've tried to change the code somewhat and it still displays the shipping options ive excluded. Any help would be appreciated!
I'm using the newest version of zen-cart and USPS module.
PHP Code:global $cart;
$chk_products15 = $_SESSION['cart']->in_cart_check('products_id','15');
$chk_products16 = $_SESSION['cart']->in_cart_check('products_id','16');
$chk_products42 = $_SESSION['cart']->in_cart_check('products_id','42');
$chk_products43 = $_SESSION['cart']->in_cart_check('products_id','43');
$chk_products73 = $_SESSION['cart']->in_cart_check('products_id','73');
$chk_products74 = $_SESSION['cart']->in_cart_check('products_id','74');
$chk_products76 = $_SESSION['cart']->in_cart_check('products_id','76');
$chk_products77 = $_SESSION['cart']->in_cart_check('products_id','77');
$chk_products81 = $_SESSION['cart']->in_cart_check('products_id','81');
$chk_products82 = $_SESSION['cart']->in_cart_check('products_id','82');
$chk_products83 = $_SESSION['cart']->in_cart_check('products_id','83');
$chk_products84 = $_SESSION['cart']->in_cart_check('products_id','84');
$skip_type = false;
if ( ($type == 'First-Class Mail International Large Envelope' ||$type == 'First-Class Mail International Package' ||$type == 'Priority Mail International Flat Rate Envelope' ||$type == 'Priority Mail International Small Flat Rate Box' ||$type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 +$chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + + $chk_products77 + $chk_products81 + $chk_products82 $chk_products83 + $chk_products84 +) > 0) {
$skip_type = true;
}
if ( ($type == 'Priority Mail International Medium Flat Rate Box' ) && ($chk_products42 + $chk_products43 + $chk_products74 + $chk_products77 + $chk_products83 + $chk_products84 ) > 0) {
$skip_type = true;
}
if ($skip_type) {
// do not show excluded shipping types
} else {
Fix this IF statement:
then ... check what the $type is by adding above the two IF statements the line:Code:if ( ($type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + $chk_products77 + $chk_products81 + $chk_products82 + $chk_products83 + $chk_products84) > 0) {
Make sure that you are testing for the correct spellings ...Code:echo 'I SEE TYPE: ' . $type . '<br>';
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
What's wrong with the IF statement? This is what I did!
Is this what you mean? nothing happened! Most likely its something I did I'd say!PHP Code:$skip_type = false;
echo 'I SEE TYPE: ' . $type . '<br>';
if ( ($type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + $chk_products77 + $chk_products81 + $chk_products82 + $chk_products83 + $chk_products84) > 0) { $skip_type = true;
}
echo 'I SEE TYPE: ' . $type . '<br>';
if ( ($type == 'Priority Mail International Medium Flat Rate Box' ) && ($chk_products42 + $chk_products43 + $chk_products74 + $chk_products77 + $chk_products83 + $chk_products84 ) > 0) {
$skip_type = true;
}
if ($skip_type) {
// do not show excluded shipping types
} else {
Your IF:
My IF:Code:if ( ($type == 'First-Class Mail International Large Envelope' ||$type == 'First-Class Mail International Package' ||$type == 'Priority Mail International Flat Rate Envelope' ||$type == 'Priority Mail International Small Flat Rate Box' ||$type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 +$chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + + $chk_products77 + $chk_products81 + $chk_products82 $chk_products83 + $chk_products84 +) > 0) {
You have extra + signs and missing + signs ...Code:if ( ($type == 'First-Class Mail International Large Envelope' || $type == 'First-Class Mail International Package' || $type == 'Priority Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box' || $type == 'Express Mail International Flat Rate Envelope' || $type == 'Priority Mail International Small Flat Rate Box') && ($chk_products15 + $chk_products16 + $chk_products42 + $chk_products43 + $chk_products73 + $chk_products74 + $chk_products76 + $chk_products77 + $chk_products81 + $chk_products82 + $chk_products83 + $chk_products84) > 0) {
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Oops... I see my mistakes!I changed the IF statement but still no change?