How do I exclude items "from stock" on the first page?

I am currently using Magento 1.1.6. My store only sells unique items (exclusive design shirts), which means there is only 1 unit available for each item at any given time.

How can I omit those already sold items from those displayed on the first page?

By the way, I am using this code to show products on the first page:

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

      

+1


source to share


2 answers


Go to System> Configuration> Catalog> Inventory> Inventory Options. in the Show Out of Stock Items drop-down list, select None.



+2


source


I assumed the file directory / product / list _home_batik.phtml is based on the /product/list.phtml directory

You can change the file directory / product / list _home_batik.phtml by adding

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

      

right after

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

      



and adding

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

      



before

<?php endforeach; ?>

      

If it doesn't work, you must provide the complete file so that I can view it.

0


source







All Articles