aeran
aeran

Reputation:

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

I'm currently using Magento 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"}}

Upvotes: 1

Views: 1258

Answers (2)

Rounder
Rounder

Reputation: 350

Go to System>Configuration>Catalog>Inventory>Stock Options. the dropdown for "Display Out of Stock Products" change to No.

Upvotes: 2

stunti
stunti

Reputation: 855

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.

Upvotes: 0

Related Questions