Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
How To Add Stock filter in Layered navigation ? 
 
VijayGadhavi
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-07-17
India
 

Hello Friend,

I want to add Stock filter based on product qty on left layered navigation.
For example: InStock Products and All Proudcts.

If i select “Instock Proudcts” then product list will filter and show all products where qty >0 in listing.
while if i select “All Products” then it will show all products in listing.

Please guide me?

Thanks in advance for your kindly help and spending you important time for this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roco
Sr. Member
 
Total Posts:  191
Joined:  2008-03-18
 

I would like to know how to do this as well?  Thanks - Rob

 
Magento Community Magento Community
Magento Community
Magento Community
 
ucommerzapps
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2009-08-18
London
 

CRUCIAL!

I have a shoe site - and the #1 complaint from my customers is it is a nightmare to find a shoe in their size which is IN STOCK!

Ideally i want the user to select their size in the layered navigation and then only show products which are in stock! Currently, Magento ignores the stock and displays all the shoes which are “Enabled”. So the customer has to manually go and see whether there size exists in the dropdown for the configurable product every time.


FYI >> All of my shoes are configurable products. Each shoe has a number of associated products with it - each one being a different size.

E.g.
Configurable: Boot1_formal
Associated; Boot1_formal_size5, Boot1_formal_size6, Boot1_formal_size7, Boot1_formal_size8

** If anyone knows of a way to make Magento “Disable” products which go out of stock - that would be the ideal situation!

** I run stock updates (using the “import profiles” interface) every couple of days - is there another script i should be running to disable all out of stock items or something?

Cheers,
Chris

 
Magento Community Magento Community
Magento Community
Magento Community
 
ucommerzapps
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2009-08-18
London
 

Anyone?

Please help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ciobi
Jr. Member
 
Total Posts:  10
Joined:  2009-08-11
 

This would be awesome to know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
fanis
Member
 
Avatar
Total Posts:  72
Joined:  2009-11-24
 

Really interested as well to know about this. This is something very custom and apparently not something that can be done via configurations and minor changes to the code i believe, but its something very powerful to have especially in such stores like shoe or cloths that are based on configurable products and their assosiated products attributes are not included in the filtering of layered navigation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
NETZKOLLEKTIV
Member
 
Avatar
Total Posts:  35
Joined:  2010-05-06
Erlangen, Germany
 

Our extension NETZKOLLEKTIV Out-Of-Stock Layered Navigation will solve your problems. It hides all products in layered navigation which are out-of-stock, including configurable products which have children, which are out of stock.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tsifra
Member
 
Total Posts:  57
Joined:  2008-09-14
 

UPDATED

Here is my solution. It’s dirty, but work perfectly.

1. Create new attribute “availbility” dropdown. Two options “Yes"/"No"
2. Add attribute “availability” to attribute set
3. Find value id’s in database, table eav_attribute_option_value. In my case yes=898, no=899
4. Edit app/code/core/Mage/CatalogInventory/Model/Observer.php
5. Find public function saveInventoryData($observer) and add code just before return $this;

old code removed

This doesn’t break updates of availability attr during import

$product_upd Mage::getModel('catalog/product')->load($product->getId());
        
$stock_qty $item->getQty();
        if (
$stock_qty 0{
            $product_upd
->setData('availability''901');
        
else {
            $product_upd
->setData('availability''900');
        
}
        $product_upd
->save();

Now every time when stock qty changes availabilty attr will also be changed

 
Magento Community Magento Community
Magento Community
Magento Community
 
WeFitted
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2010-09-05
 
tsifra - 07 August 2010 06:40 AM

UPDATED

Here is my solution. It’s dirty, but work perfectly.

1. Create new attribute “availbility” dropdown. Two options “Yes"/"No"
2. Add attribute “availability” to attribute set
3. Find value id’s in database, table eav_attribute_option_value. In my case yes=898, no=899
4. Edit app/code/core/Mage/CatalogInventory/Model/Observer.php
5. Find public function saveInventoryData($observer) and add code just before return $this;

old code removed

This doesn’t break updates of availability attr during import
$product_upd Mage::getModel('catalog/product')->load($product->getId());
        
$stock_qty $item->getQty();
        if (
$stock_qty 0{
            $product_upd
->setData('availability''901');
        
else {
            $product_upd
->setData('availability''900');
        
}
        $product_upd
->save();

Now every time when stock qty changes availabilty attr will also be changed

arrgh its not working for me.

in my case the values were yes=67 and no=69.

If your values were 898 and 899 why did you put 900 and 901 in the code?

im so confused.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 
chrisroseuk - 10 December 2009 05:50 AM

I have a shoe site - and the #1 complaint from my customers is it is a nightmare to find a shoe in their size which is IN STOCK!

Ideally i want the user to select their size in the layered navigation and then only show products which are in stock! Currently, Magento ignores the stock and displays all the shoes which are “Enabled”. So the customer has to manually go and see whether there size exists in the dropdown for the configurable product every time.

The Improved Navigation fixes this bug of the Magento and shows only “In Stock” options in the layered navigation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
LaSto
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-10-21
Bucharest, Romania
 

Thanks for all the paid modules, but we need a free solution.

Anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
naujasdizainas
Sr. Member
 
Avatar
Total Posts:  128
Joined:  2007-11-04
Lithuania, Vilnius
 
tsifra - 07 August 2010 06:40 AM

UPDATED

Here is my solution. It’s dirty, but work perfectly.

1. Create new attribute “availbility” dropdown. Two options “Yes"/"No"
2. Add attribute “availability” to attribute set
3. Find value id’s in database, table eav_attribute_option_value. In my case yes=898, no=899
4. Edit app/code/core/Mage/CatalogInventory/Model/Observer.php
5. Find public function saveInventoryData($observer) and add code just before return $this;

old code removed

This doesn’t break updates of availability attr during import
$product_upd Mage::getModel('catalog/product')->load($product->getId());
        
$stock_qty $item->getQty();
        if (
$stock_qty 0{
            $product_upd
->setData('availability''901');
        
else {
            $product_upd
->setData('availability''900');
        
}
        $product_upd
->save();

Now every time when stock qty changes availabilty attr will also be changed

And if Massaction update
in file /app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php
after

if ($stockDataChanged{
add
//
                    $product_upd Mage::getModel('catalog/product')->load($productId);
                    
$stock_qty $stockItem->getQty();
                    if (
$stock_qty 0{
                    $product_upd
->setData('availability''yours_id');
                    
else {
                    $product_upd
->setData('availability''yours_id');
                    
}
                    $product_upd
->save(); 
                    
//
yours_id replace with id option in yors system
 
Magento Community Magento Community
Magento Community
Magento Community
 
sourav the inventer
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2010-06-11
India, Westbengal, Kolkata
 

Here is my solution. It’s dirty, but work perfectly.

1. Create new attribute “availbility” dropdown. Two options “Yes"/"No"
2. Add attribute “availability” to attribute set
3. Find value id’s in database, table eav_attribute_option_value. In my case yes=46, no=45.
Edit app/code/core/Mage/CatalogInventory/Model/Observer.php
5. Find public function saveInventoryData($observer) and add code just before return $this;

where 46 and 45 is option_id

$product_upd Mage::getModel('catalog/product')->load($product->getId());       
       if (
$item->getIsInStock()) {
            $product_upd
->setData('availability''46');
        
else {
            $product_upd
->setData('availability''45');
        
}
        $product_upd
->save();
 
Magento Community Magento Community
Magento Community
Magento Community
 
DavorNo
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-07-26
 

I use CE 1.6.2.0 and I try all from this topic, but nothing is working. Is there any specific setup when creating availability attribute? In product page filter availability is empty, and there is no showing in layered navigation. Anyone?

Regards,
DavorNo.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kajal
Member
 
Total Posts:  60
Joined:  2010-06-27
 

Hi all,

Even I’m running through this situation.
I will create a module to do the needful but till than to manage stock levels, you can have a look at the following thread :
http://www.magentocommerce.com/boards/viewthread/299344/

If you wont update the qty in cs it will automatically run the cron at 1 hr and will manage to get your stock updated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

Hi @kajal, since you posted this question in the Magento 1.3.0 Upgrade Issues forum, did you recently upgrade to 1.3.0 or from 1.3.0 to the latest version?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2