1
votes

I'm doing product imports using magmi via the API. My script parses a csv file into $product_rows, then loads a product in mage using my attribute to get the sku for magmi to use. I'm doing it this way because later I will be using an external db with the magento skus already loaded to take advantage of the speed of magmi import. Here's how I pull the skus in mage:

$magentoproducts = Mage::getResourceModel('catalog/product_collection')
                    ->addAttributeToSelect('*')
                    ->addAttributeToFilter('mpn', $product_row['mpn'])
                    ->addAttributeToFilter('brand', $_POST['selectbrand'])
                    ->load();
foreach($magentoproducts as $product){

                $items[] = array(
                "store" => 'admin',
                "sku" => $product->getSku(),
                "price" => $product_row['map']
                );

            }
foreach($items as $item){
            $dp->ingest($item); //do the update
        }

The problem is that my prices are updated in the manage products page for magento, but they do not show up in the catalog. I then put the following code to reindex catalog_product_price, which changes the price shown on search pages, but not the actual product page or the cart when a product is added.

Mage::getModel('index/indexer')
    ->getProcessByCode('catalog_product_price')
    ->reindexAll();

I've tried manually reindexing several other indexes in the magento admin panel, as well as clearing the cache also from the magento panel. The only thing that gets the price updated on all pages is refreshing the product from the enhanced product manager in magento, though it takes about 2-3 seconds to do it. Which indexes does this action reindex? which caches?

1
Are the prodcuts enabled? Are they visible for "catalog" and for "search"? Are the items in stock? Are they put into a category? Does that category exist?jmunsch

1 Answers

1
votes

May be you have enabled FLAT mode for products. If so, try call next command after updating:

Mage::getResourceModel('catalog/product_flat_indexer')->rebuild();