Question

My custom attribute is, PreBook[ Text Field ]. How can I add my custom text Book Your PreBook to my selected store & selected SKU's? Managed products bulk attributes option taking too many time, how to do by using a better way?

No correct solution

OTHER TIPS

You can create below script and run it on your website to update the attribute value for selected products.

require_once('app/Mage.php');

umask(0);
Mage::app('default');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$productCollection = Mage::getModel('catalog/product')->getCollection();

$skus = array('comma seprated SKUs for updating product attribute');

foreach($productCollection as $product) {

    if (in_array($product->getSku(), $skus)) {
        $product->setData('your_attribute_code', 'Book Your PreBook');
        $product->getResource()->saveAttribute($product, 'your_attribute_code');
    }   

}

Please make sure to test it on the local or Staging server first before running it to Live.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top