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!
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!
In answer to the question as to where to place the code
You need to be customizing the file:
/includes/modules/shipping/filename.php
where filename is the name of the shipping method that you want to hide or show. Note you have to place this code in all the methods that you want to hide and show. In my case, I put it in zones to hide it and item to show it and just swapped the last two statements about true and false.
I must still be missing something. Now Zones show up no matter what is in the cart and item shipping never shows up. It should show only item if the whole cart is books and zone other wise. Here's the code for both files. I have checked and model is set to book.
// disable when products_model is not all books this goes in zones
global $db;
if (($total_count - $_SESSION['cart']->count_contents('products_model','book') == 0)) {
// hide
$this->enabled = false;
} else {
// show
$this->enabled = true;
}
// enable when products_model is all books this goes in item
global $db;
if (($total_count - $_SESSION['cart']->count_contents('products_model','book') == 0)) {
// show
$this->enabled = true;
} else {
// hide
$this->enabled = false;
}
![]()
I need no free shipping for one category only...
I need to add only this code to freeoptions.php?
(it doesn't operate!)PHP Code:if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','107') > 0)) {
$this->enabled = false;
}
thank you very much
Depends on where you put that in the code ...
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!
Ajeh - thank you for your reply, much appreciated :)
I was adding the code into the wrong place! oops my bad!
Thanks for the update that you were able to get the code working after placing it in the right location of the file ...![]()
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!
annoyingly, the client has changed their mind and gone with the way i originally suggested haha
At least i will know now for next time, adn will be able to part my new found knowledge with others
Ajeh
Any suggestions for my code in #124? I think it will help a lot of people in this thread.
Thanks
Shirley