If this is your first visit, check our documentation. To post, register or login.
Forums / Customization from the Admin / How to display "soldout" icon in "new products" area?

How to display "soldout" icon in "new products" area?

Started by zeliana on 23 Oct 2012, 5:34 AM · Views: 1,149

Results 1 to 2 of 2
23 Oct 2012, 5:34 AM
#1
zeliana avatar

zeliana

New Zenner

Join Date:
Oct 2012
Posts:
1
Plugin Contributions:
0

How to display "soldout" icon in "new products" area?

Originally I had our cart setup to disable and not show items when stock reached zero. Now I would like to have it setup to show the item as soldout, with no shopping cart add button. When I changed the settings to show a soldout icon it appears on the actual products page, and in the categories listing...but in the "new products" banner under the categories and at the bottom of the main page it does not show the soldout icon until the customer opens the specific product.

I don't want to annoy my customers by clicking on items just to see they are sold out. However we do a lot of one-of-a-kind items and I like customers to see what sold recently so they can discuss getting a similar item.

How can I get the soldout icon to appear in the "new products" area under the pic/description?

Thank you for any help you can offer.
(ps I searched and experimented for a few hours before posting this)

23 Oct 2012, 8:15 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How to display "soldout" icon in "new products" area?

You could customize, using your templates and overrides, the file:
/includes/modules/new_products.php

and around line 71 add the code:

    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price[B] . (zen_get_products_stock($new_products->fields['products_id']) <= 0 ? '<br>' . zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT) : '')[/B]);

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!