Magentocommerce - How to exclude 'out of stock' items from the front page?

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

I'm currently using Magento ver 1.1.6. My store only sells unique items (shirts with exclusive designs) which means at any one time, only 1 unit is available for each items.

How do I omit those items which are already sold from being displayed in the front page?

BTW, I'm using these code to show products on the front page:

{{block type="catalog/product_list" category_id="3" template="catalog/product/list_home_batik.phtml"}}

I supposed the file catalog/product/list_home_batik.phtml is based on catalog/product/list.phtml

You can modify the file catalog/product/list_home_batik.phtml by adding

<?php if($_product->isSaleable()): ?>

just after

<?php foreach ($_productCollection as $_product): ?>

and by adding

<?php foreach ($_productCollection as $_product): ?>

just before

<?php endforeach; ?>

If it doesn't work, you should provide the complete file so I can have a look at it.

`Reply Or Comment!
Please LogIn to Reply!