You need to know the master_categories_id for the product when using this function to change the Sold Out image ...
This line selects the data:
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
if you change it to read:
$button_check = $db->Execute("select product_is_call, products_quantity, master_categories_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
You now can identify the categories_id to change the sold out ... where $button_check->fields['master_categories_id'] is the categories_id to identify which one the Product uses as its main Category ...
This case statement manages the Sold Out settings:
case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1'):
if ($_GET['main_page'] == zen_get_info_page($product_id)) {
$return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);
} else {
$return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);
}
break;
The IF is managing which Sold Out image to send ...
You need to customize that section based on the categories_id that you get from:
$button_check->fields['master_categories_id']
Does that help you some? :smile:
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!