Forums / Templates, Stylesheets, Page Layout / Sold Out image on product listing

Sold Out image on product listing

Started by theo on 22 Oct 2011, 7:28 PM · Views: 941

Results 1 to 2 of 2
22 Oct 2011, 7:28 PM
#1
theo avatar

theo

New Zenner

Join Date:
Dec 2010
Posts:
9
Plugin Contributions:
0

Sold Out image on product listing

So I've been asked to put in a sold out sticker over the product image when it's.....well sold out. Now doing this in css would be easy enough to layer the new image. However I cannot for my life figure out how to check if a product is at 0 quantity or not on my product listing pages.

I looked in to the tpl_modules_main_product_image file and was able to check there and display a custom picture however that is not called on the listing pages only on the product_info page where a sold out tag is already displayed. From what I can gather the information on the listing pages is from the $list_box_content variable. But I'm unsure how to check this for quantity on each product.

Any insite would be appreciated. Many thanks in advance.

23 Oct 2011, 2:46 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Sold Out image on product listing

In the product_listing.php module, you can test the quantity with:
$listing->fields['products_quantity']

If it is <= 0, then it is sold out ...

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!