I do not know exactly how your Payment module is setup, but if you needed this customization to Check/Money Order moneyorder, you could change the code by adding the code in RED to the file:
/includes/modules/payment/moneyorder.php
$this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
[B]// bof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
if (!IS_ADMIN_FLAG) {
// check the count of a specific field
$chk_cat = 0;
// check how many Products are in the cart for master_categories_id 10 and 12
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','12');
// if any are found turn off the shipping module
if ($chk_cat != $_SESSION['cart']->count_contents()) {
$this->enabled = false;
}
}
// eof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
[/B]
if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) {
and only when the Shopping Cart contains Products with the master_categories_id 10 and/or 12 would the module show ...
If the content of the Shopping Cart is from any other master_categories_id values other than 10 and/or 12, the module would NOT show ...
See if you can't adapt it to your needs ...
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!