Hi Ajeh,
The product ID's for Express Mail International (EMS) Flat-Rate Envelope and Priority Mail International Flat-Rate Envelope are 15,42,16,43. And for First Class Mail International Package 42 and 43.
Hope this is right!
Cheers! :smile:
Printable View
Hi Ajeh,
The product ID's for Express Mail International (EMS) Flat-Rate Envelope and Priority Mail International Flat-Rate Envelope are 15,42,16,43. And for First Class Mail International Package 42 and 43.
Hope this is right!
Cheers! :smile:
Now adapt the code in #6 to use them ... :smile:
To be honest I'm not sure what to do. Can I just put that same code in twice. One for the 4 products and again for the two?
I am really really bad at PHP!
This gave you the total of what is in the cart for categories based on the master_categories_id when set to 11 or 12 ...
This would work for products:Code:$chk_cats = $_SESSION['cart']->in_cart_check('master_categories_id','11') + $_SESSION['cart']->in_cart_check('master_categories_id','12');
have more than 2 products_id values to check, keep adding them on ...Code:$chk_prods = $_SESSION['cart']->in_cart_check('products_id','11') + $_SESSION['cart']->in_cart_check('products_id','12');
Now you want to check how many products are in the cart you have $chk_prods ...
You want to check the $type for the shipping method ...
Not sure what the shipping method is, then do an echo on it by uncommenting the:
NOTE: you can also add to that echo the $chk_prods to see the results ...Code:// echo 'shipping ' . $type . ' chk_cats: ' . $chk_cats . '<br>';
Last question!!
Would this work?
PHP Code:
global $cart;
$chk_cats = $_SESSION['cart']->in_cart_check('products_id','15') + $_SESSION['cart']->in_cart_check('products_id','16' + $_SESSION['cart']->in_cart_check('products_id','42' + $_SESSION['cart']->in_cart_check('products_id','43');
// echo 'shipping ' . $type . ' chk_cats: ' . $chk_cats . '<br>';
if ($type == 'Express Mail International (EMS) Flat-Rate Envelope' && $chk_cats > 0) {
if ($type == 'Priority Mail International Flat-Rate Envelope' && $chk_cats > 0) {
$chk_cats = $_SESSION['cart']->in_cart_check('products_id','42') + $_SESSION['cart']->in_cart_check('products_id','43');
// echo 'shipping ' . $type . ' chk_cats: ' . $chk_cats . '<br>';
if ($type == 'First Class Mail International Package' && $chk_cats > 0) {
// skip shipping
} else {
Not if you are trying to add them all up ...
Can you type out slowly what it is you want this to do in detail ...
You have Category issues with shipping types ...
You have Product issues with shipping types ...
You need to break these out carefully so that each shipping type that needs to be tested is using the correct testing ...
Hi Ajeh,
I want products 15,16,42,43 to ship by everything but Express Mail International (EMS) Flat-Rate Envelope and Priority Mail International Flat-Rate Envelope. I also want products 42 and 43, as well as not being shipped using the above two shipping types but also First Class Mail International Package.
Thanks a million!
Ajeh, would you please help me!
I have not had the time to rewrite the code for you ... when I get some time I will try to look into this further ...
Hopefully there is enough information in this thread to show you how to count the number of products in the cart based on master_categories_id or products_id etc. and how to find the $type for the shipping method to try coding this for yourself ...
Trust me. I have tried! If you get a chance that would be great.