Thanks for the update that this is working for you ...
Thanks for the update that this is working for you ...
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!
ok, i know this is an old thread, but it may be exactly the thing I need.
I have test the above code and it works like a charm, but the way it is, its not really any use to me. (not on this project anyway, but will be for others)
What I am wondering is, instead of setting it for one product ID, is it possible to set it for a range of product IDs.
So instead of this:
is it possible to do soemthing like thisCode:if ($_SESSION['cart']->in_cart_check('products_id','12') > 0) { $this->enabled = false;
I know thats not the way its done, but thought by givig a visual it might help someone to understand what im looking for, because I know im really bad at explaining things. lolCode:if ($_SESSION['cart']->in_cart_check('products_id','1 - 1000') > 0) { $this->enabled = false;
Thanks
DB
$_SESSION['cart']->in_cart_check will check for information from the products table ...
You can check for the master_categories_id which is useful for a Category of Products where all Products are using the same Category ...
Can you give more details about what you are trying to do?
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!
Disabling a payment module using the master category id has done the trick.
This is what I have done using the check/money order module as a test point:
It seems to work, but not sure if its a bit long-winded.Code:// disable if categories 1, 2, 3, 4 if in the cart if ($_SESSION['cart']->in_cart_check('master_categories_id',"1") > 0) { $this->enabled = false; } if ($_SESSION['cart']->in_cart_check('master_categories_id',"2") > 0) { $this->enabled = false; } if ($_SESSION['cart']->in_cart_check('master_categories_id',"3") > 0) { $this->enabled = false; } if ($_SESSION['cart']->in_cart_check('master_categories_id',"4") > 0) { $this->enabled = false; } }
Just tried it on the Alertpay payment module and it doesnt work
Where do you have the code?
You are showing an extra closing bracket but not what it is balanced against ...
Have you checked your Products to ensure what categories_id is used for the master_categories_id?
Do you have a:
global $cart;
above the testing?
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!
Thanks for the reply Linda, much appreciated.
I have it working now. I prefer to use the older Alertpay 1.1 payment module because its the only one that doesnt usually through up any problems. But I popped the 1.3 version over to the cart and added the code to it and it worked just fine.. must be just the old module that didnt want to play nice with me. Although, I have looked through it a good bit and still cant see how it would not disable because everything seemd to look just as most other payment modules do for the first part up to about here --if ($check_flag == false) {--.
Anyway, its working just the way I want now, so big thanks for posting the code back in early 2009. Im sure there are many people who have benifited from it. :)
All the best, and thanks again for your replies.
DB
Thanks for the update that you have this working now ...
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