I have a new store view and i've updated all the products using the
magento admin: Manage Products > Select all > Update Attributes
and then selecting the new store. Now that all my products are affiliated with my new store view i'm having a problem with all my images. On the front end it shows all placeholders. In the admin panel when i click on a product and then images.. it may have images but it's not selected to use base image, small image or thumbnail.
Is there a way to update all images on my new store view to use the default store view main images?
require_once 'abstract.php';
class Attach_Default_Store_Images Extends Mage_Shell_Abstract {
public function run()
{
$products = Mage::getModel('catalog/product')->getCollection();
foreach ($products as $product) {
$productFrom = $product->setStoreId(1)->getImage();
$productTo = $product->setStoreId(13)
->setImage($productFrom)
->setSmallImage($productFrom)
->setThumbnail($productFrom);
echo "Images Updated\n";
$product->save();
}
Mage::getModel('catalog/product_image')->clearCache();
echo "Image Cache Cleared\n";
}
public function usageHelp()
{
return <<<USAGE
Usage: php -f cache.php -- [options]
php -f cache.php -- clean
clean Clean Old Cache
help This help
USAGE;
}
}
$shell = new Attach_Default_Store_Images();
$shell->run();
Run a shell script with above?