Discussions

Not showing out of stock items

I am new to Drupal Commerce.
can someone suggest me how to prevent items (with or without attributes) which are out of stock from displaying in the front-end?
Thanks in advance..

Posted: Dec 7, 2011

Comments

commercestudy on December 7, 2011

Have you tried the stock module for Drupal Commerce?

It will allow you to put an extra field in your product type, that you can enter how much stock of each item you have. Once it runs out, it can not be purchased and the add to cart button on such items will change to say out of stock

http://drupal.org/project/commerce_stock

Then to activate the stock module for which content type you want to use it on, you simply go to Stock management:

Home » Administration » Store » Configuration » stock management

and check the checkboxes under the heading "Enable stock management for these product types", that match your product types

Then click the submit button and a stock input for stock count will show in each of your products that are part of a stock enabled product type

t.basak on December 7, 2011

Hi commercestudy, thanks for responding..
I am already using commerce stock module. Currently for the items whose stock is zero, "out of stock" button is appearing. But my requirement is something specific. I do not want to display those items in the front-end whose stock is set as zero(0).
Thanks in advance...

rfay Randy Fay on December 30, 2011

The concept of "Disabled" for the product may be useful to you. It means not offered for sale, and the front end add-to-cart forms display "Not available" when the product is disabled. (Also, it is immediately removed from any carts).

If you're using a view to present product nodes or products, you could also add a filter to the view that excludes disabled (or 0-stock) products.