0

I need to re-save all products in magento. I found solution (for 1.7 version):

<?php
set_time_limit(0);

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $product) {
    echo $product->getName() . '<br/>';
    // save the product
    $product->save();
}

echo 'DONE';
?>

But this not working for magento 1.9. I need to re-save all configurable products, if it possible.

Oleg Frolov
  • 89
  • 11
  • Why do you need to "re-save" all configurable products? Some background information on your use case would help... – drj201 Sep 15 '14 at 14:44
  • Because imported products did not show correnctly in frontend. But when I manually re-save product in admin panel - all data displays fine for saved item. But I have 8563 items. I found that it works even I make re-save only for configurable product - all childs saves to. – Oleg Frolov Sep 15 '14 at 16:02
  • Have you tried reindexing all indexes? – drj201 Sep 15 '14 at 16:21
  • Yes, but it not helps. I found solution about to re-save products and for manual save it works fine. But I have a lot of products so I need mass re-save solution... – Oleg Frolov Sep 15 '14 at 18:41
  • Okay - how are you importing your products? – drj201 Sep 15 '14 at 19:32

1 Answers1

0

It works, but you cannot see product name, try use sku field

Aleksandr
  • 193
  • 1
  • 6