That's awesome! It seems like everything works now, and if I need to add more categories I can. You are incredible!![]()
That's awesome! It seems like everything works now, and if I need to add more categories I can. You are incredible!![]()
Glad to hear that this 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!
Hi Ajeh!
I was wondering if you would help me with media mail!
I have:
Books (Parent id:4) no child categories
Computer (Parent id:11) with child categories:
Games (id:19)>
1.00 games (id:22)
Educational games (id:25)
Other games (id:24)
Programs (id:20)>
1.00 programs (id:23)
I want media mail to show up when ever there is only one or more item from one of these categories, or a combination of only these categories, but I don't want it to show up if there is anything in the cart that is not one of these categories...for example: if they bought 3 books and 10 cd games, then media mail would show up, but if they bought 3 books, 10 cd games and a basketball, then media mail would not show up.
I am really not savy at all when it comes to code or knowing where it should go, so PLEASE include this in your instructions! Thank you so, so much!
Shipping has been really expensive without the media mail option, as I have turned it off.
![]()
You would use the same thing as what I posted but put in your master_categories_id for as many categories that are allowed in:
What this is doing is counting how many products come from that categories_id ... in this case it is testing for categories_id 22 when that is the master_categories_id ...Code:$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','22');
If they are added up and do not match the count of all items in the cart, then the Media Mail is skipped ...
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!
Thank you! So is this an example of what it should look like?
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','22');('master_categories_id','4');('master_categories_id','11');('master_categories_id','19');
and so on?
In a word ... no ...
If you peek at the code in post #10, for the categories_id 22, 4, 11 and 19 that are used as the master_categories_id of the Products in the products table, you should change the code to:
You need 1 line per categories_id that ARE allowed ...Code:// test contents for Media Mail $skip_media = false; $chk_media = 0; $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','22'); $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','4'); $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','11'); $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','19');
Now if you have a lot of categories you may want to customize this code even further than it is ...
Last edited by Ajeh; 1 Feb 2010 at 02:41 AM. Reason: changed for clarity
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!
Ok! Thanks Ajeh!
But...I am a bit confused at what you said, quote: You need 1 line per categories_id not allowed ...
The categories you have listeded in your code you wrote for me ARE the categories I want to ALLOW for media mail. Those categories I listed are the only categories I have right now that would warrant media mail. So....the code you wrote will allow media mail to show up if they choose ONLY from those categories...is that correct?
I'm so sorry Ajeh...I feel so dumb...I wish I understood code. I only understand a little bit of html and I mean only a little bit! Thank goodness there are people out there who know what they are doing like yourself!!!!
Sorry ... my bad ... that one is written for which categories "are allowed" ... I write too many of these things ...![]()
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!
Ok! I will give it a whirl!![]()
Thank you!
Ugh...not working...this is what I've plugged into my usps.php:
// test contents for Media Mail
$skip_media = false;
$chk_media = 0;
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','4');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','19');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','20');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','22');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','24');
$chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','25');
if ($chk_media != $_SESSION['cart']->count_contents()) {
$skip_media = true;
}
Each of the above id's have either computer cds/programs or books. Media mail is showing up ALL THE TIME. Even if there is only one item that is NOT EVEN FROM THE ANY OF THE ABOVE MEDIA ID'S...what am I doing wrong?