Glad that this is working for you now ...
Thanks for the kudos and support we really appreciate it a lot ... coffee and donuts keep the Zen Cart Team humming right along ...
Glad that this is working for you now ...
Thanks for the kudos and support we really appreciate it a lot ... coffee and donuts keep the Zen Cart Team humming right along ...
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: v1.5.5]
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 was trying to get the Media Mail restrictions to work as well and added the code per the instructions above.
I am using the latest version Version: 2014-09-07 K5
And instead of using Media MailRM, I had to use Media Mail Parcel
I used the print_r($type_rebuilt);
that linniedarling suggested and it output:
First-Class Mail ParcelMedia Mail ParcelPriority MailTM
So I guess that's what you all were doing and it seems to have worked for me.
I am not that good with PHP at all (took me 2 hours just to get this working)
So if anyone could double check to make sure
Yes, you need to use:
USPS renamed it on the September 7, 2014 changes ...Code:$type == 'Media Mail Parcel'
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: v1.5.5]
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!
Dontcha hate when you get interrupted when posting only to find your answer posted 2 minutes before your own ...
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: v1.5.5]
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!
Tee-hee, it happens to me all the time!
Hi
I have added this modification to my shop. My media related items are located within sub-categories of the parent category
EX:
books (id 342)
- cookbooks (id 24)
- childrens books (id 52)
- old school books (id 72)
I have 32 sub categories in the books category but that sub category amount will probably increase over time. Is there a way to add the parent category ID 342 in such a way that all its sub categories would be included without having to add the ID for each subcategory manually?
using
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','342');
doesn't work so I need to add the sub cat id instead
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','24');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','52');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','72');
If it's possible it would be good because I have a feeling a few months from now if I add a new sub cat I will probably forget to edit the usps.php file.
thanks
You could use this code in RED to count how many products are in the cart for that parent categories_id:
Just change the $chk_cat to your parent categories_id 342 and $chk_cart will have the quantity that is in the cart ...Code:// see below use of $chk_cart // eof: example to block USPS Priority MailTM Small Flat Rate Box when anything from master_categories_id 12 or 15 are in the cart // bof: skip Products in any subcategory for parents_id 3 $subcategories_array = array(); $chk_cat = '3'; // parent categories_id $chk_cart = 0; zen_get_subcategories($subcategories_array, $chk_cat); for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id', $subcategories_array[$i]); } //echo 'USPS products in parent category 3: ' . $chk_cart . '<br>'; // eof: skip Products in any subcategory for parents_id 3 for ($i=0; $i<$PackageSize; $i++) {
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: v1.5.5]
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!
thank you
ohhh I'm sorry, I forgot that some books are in sub sub cats too. Would that significantly change the code you provided?
For instance
books (id 342)
- cookbooks (id 24)
- childrens books (id 52)
- old school books (id 72)
- crafts and hobbies (id 97)
-- a sub sub cat (id 231)
-- a sub sub cat (id 321)
-- a sub sub cat (id 523)
If you need to calculate the Products in the Shopping Cart for both a Parent Category and then additional categories, beneath the code that I gave you to calculate the Products from all categories within a parent category, you can add the additional categories you need with:
to combine the products that match ...Code:$chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','231'); $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','321'); $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id','523');
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: v1.5.5]
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!
Bookmarks