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?
1. Go to Stores > All Stores and choose the Store you want to change the default store view for. 2. In the Default Store View section set the Store View you want to be a default one for this particular store and press Save Store button.
Navigate to Stores > Configuration > General > Web and find the Url Options section. There you choose to Add Store Code to URLs selecting Yes from the corresponding select box and Save Config.
You can use magmi for this , just export the products CSV from magento admin, and re-import the required fields like SKU, image, small_image and thumbnail through magmi and it will do your work very fast and easily.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With