1

I have a script that mass creates products from a remote database to my Magento database. I'm sure I have created entries into every table required for the product to exist in Magento, but when I go to view the product, I can see the product page, but the product options like Color, Size, and the price do not display, along with the Add to cart button. When I go in the backend and save the product manually and go back to the product page everything appears like it should and works fine. I then created a php script to go through and save each dynamically added product using magento's save function, it loops through and saves the products, but this doesn't work, they still will not display correctly unless saved through the website.

Tables inserted into to create a product:
catalog_product_entity
catalog_product_entity_int
catalog_product_entity_varchar
catalog_product_entity_text
catalog_product_entity_decimal
catalog_product_entity_datetime
catalog_category_product
catalog_category_product_index
catalog_product_entity_media_gallery
catalog_product_entity_media_gallery_value
cataloginventory_stock_item
cataloginventory_stock_status
catalog_product_index_price
catalog_product_index_eav
catalog_product_website
catalog_product_super_attribute
catalog_product_super_attribute_label
catalog_product_super_attribute_pricing
catalog_product_relation
catalog_product_super_link

When I compare values to a dynamically created product and one that is already in Magento and works they are both the same, I'm just unsure of why it won't show up unless saved through the website. Any help would be appreciated, thanks!

1

I had the same problem using Magmi and full reindex solved the problem.

I think it works after the product save in admin because the indexer is updated in product save.

I'm putting it here as an answer as I don't have permission yet to comment..

  • Does the indexer not get updated when saving a product in the backend? Using the $product->save(); method? I always do a full re-index after each batch of products is inserted but will try again, thanks – Iqbal Khan Dec 27 '16 at 14:49
  • Updated the index, same results, products not showing unless manually saved – Iqbal Khan Dec 28 '16 at 17:21
  • @IqbalKhan Try dumping the DB before and after the manual save and see whats the difference. – shemaya Dec 29 '16 at 9:15
1

From My point of view also this is a reindex issue you can do reindexing programetically after you upload your product.

$indexCollection = Mage::getModel('index/process')->getCollection();
foreach ($indexCollection as $index) {
    /* @var $index Mage_Index_Model_Process */
    $index->reindexAll();
}

The above code is for reindexing

  • I am running a full index now, but after each batch upload of new products I would do a full re-index through the shell by running: /var/shell/indexer.php reindexall Or by re-indexing each index individually by using --reindex <indexer> – Iqbal Khan Dec 27 '16 at 14:47
  • Problem still wasn't solved each time after I indexed but I will run through now and make sure each index is fully processed and done, i'll let you know how it goes, thanks – Iqbal Khan Dec 27 '16 at 14:48
  • Updated the index, same results, products not showing unless manually saved – Iqbal Khan Dec 28 '16 at 17:21
0

I finally found a solution to the problem. Here is the answer on stackexchange: Configurable Product options box not showing on the front end

It had to do with the option container settings, and even though when i dynamically added the products I explicitly set it to use 'container1' it for some reason wasn't registering this. But creating a PHP script and executing:

Mage::getModel('catalog/product')->load()->setOptionsContainer('container1')->save();

on each product made them all start to display correctly.

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.