0

I have setup a CRON job for updating the stock in my Magento store regularly.

I have set the Magento configuration as not to show any product with respect to which all the associated products are out of stock. But it is not happening automatically.

The product still shows up on the product page and disappears only when I go to the product page in configuration and save it again explicitly.

Can someone kindly let me know why this is happening and how can I resolve this?

Any Help would be appreciated. Thanks in Advance.

1 Answer 1

0

All stock data is indexed in cataloginventory_stock_status_idx table.

Keep in mind, that if you make any changes in your cataloginventory_stock_item it won't work untill you make reindex process which you can initiate from magento backoffice or using for example magerun.

Another option is to regenerate it programatically:

$process = Mage::getModel('index/indexer')->getProcessByCode('cataloginventory_stock');
$process->reindexAll();
2
  • Ok. But, would saving the product from the backend explicitly again would do the reindexing too. Because once I did that the product used to disappear from the frontend immediately. Commented May 25, 2018 at 11:25
  • Yes - saving product from backend is always refreshing indexes (not only stock). Be sure to set product with correct visibility and stock status.
    – dudzio
    Commented Jun 12, 2018 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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