0

I have 2 stores. In each store, the products have different metadata titles and descriptions. Now I want to erase the product metadata title and description from store 2 and check "use default value". So that store 2 is using the metadata from store 1. The problem is , I have 3780 products... so manually isnt an option. Who can help me? regards

0

You can try below code......

<?php
$storeId = "your storeId";
$productCollection = Mage::getModel('catalog/product')->getCollection();
$productCollection->addStoreFilter($storeId);

foreach ($productCollection as $_productCollection) {
    $productObject = Mage::getModel('catalog/product')->setStoreId($storeId)->load($_productCollection->getId());
    $productObject->setMetaTitle('');
    $productObject->setMetaKeyword('');
    $productObject->setMetaDescription('');
    $productObject->save();
}

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.