I've a PHP script that import products from an external XML File using AWS Fast Simple Import, a magento extension.
Every X minutes it call the XML and check if the product is modified or is new, then it updates or create a new product.
The problem is when a product become unavailable. I've already set up the configuration of magento to NOT SHOW the unavailable products but every time the script goes the unavailable products appear on the catalog page.
So I tried to reindex manually the catalog_product_price and if I refresh the catalog page it works correctly.
But when I do it from PHP using this code:
$process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price'); $process->reindexAll();
It doesn't work. I mean if I look at the latest index time it works but in the catalog view I still see the unavailable products.