0

When our site was created for us, it was set to manage inventory levels. When the developers handed it off to us, I turned inventory off in the System Configuration. Since then, the items I've added don't display the 'Add to Cart' button. Using the debugger, I found that the items not displaying that option had an 'Out of Stock' status.

<p class="availability out-of-stock">Availability: <span>Out of stock</span></p>

I've tried reverting the global setting and changing the individual items to 'In Stock'. I flushed the cached after making each change. It seems like there's a setting the database that's not getting changed when I revise the settings. Anyone know where this might be?

Edit: On further testing, this issue is only on items I've already created. Newly created items don't have an issue when inventory is turned on. I still need to fix the batch of items I had already created, though.

2
  • 1
    Did you try to rebuild the Indexes (like Stock Status)? – Vladimir Kerkhoff Aug 22 '13 at 17:35
  • I had reindexed everything. Just to be safe, I just tried to modify an item, then reindex, but no difference in the status. – Tom Damon Aug 23 '13 at 18:13
2

Tom, You have several choices, depending on your time and experience level with Magento and PHP.

If your time is short and need great, we use a product http://amasty.com/extended-product-grid.html and it is very helpful for a variety of functions in product management. Purchased it for $99 US and would do it again. (I'm not a part of Amasty in any way)

If you have time and interest in further learning Magento you could extend the product grid to show the field needed. Then use that field to find items via search that are out of stock and qty > 0 and mass update.

And if you have a test server all the better.

Assuming Magento 1.7.02 I tried the following, line numbers slightly modified from earlier version in this post: the last entry on the first page by "joeymetro".

1) Copy over app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php to app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php
This makes it more upgrade proof.

2) Edit app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.phpnand add the code below. After the code on line 63
In _prepareCollection()

AFTER

 ->addAttributeToSelect('type_id');

and before

 if (Mage::helper('catalog')->isModuleEnabled('Mage_CatalogInventory'))
 {

Add this:

  $collection->joinTable( 'cataloginventory/stock_item','product_id=entity_id', array("stock_status" => "is_in_stock") )
 ->addAttributeToSelect('stock_status');

3) Then below around line 209 after

        'index' => 'price',
     ));

Add:

 $this->addColumn('stock_status',
             array(
                 'header'=> 'Stock Status', 
                'width' => '60px',column
                'index' => 'stock_status',
                'type'  => 'options',
                'options' => array('1'=>'In Stock','0'=>'Out Of Stock'),
        ));

Save that file!

Now refresh your grid and you should see the stock status field. First Search Stock Status = "Out of stock" and Qty From 1 , Next Select all Then select the Action of Update Attributes and Press Submit. Look in the Inventory section at the bottom and click on change then change to in Stock.. and press save. when it returns to the grid, no record will be displayed until to clear the filters!

I hope this helps.

2
  • Looks like that's what I needed. I'll be putting this on the test server and will provide feedback when I get it tested. – Tom Damon Aug 23 '13 at 18:17
  • Tom, Is there any reason that a product would be OutOfStock if the QTY was > 0? If all your products that are qty > 0 should be In Stock, I have an even better answer. Just use that last part and select ALL products with qty "from 1". and follow the Update attributes. That code was fun to grab and put on my test server but it may not be needed. Dan – Dan Aug 25 '13 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.