Skip to content

Instantly share code, notes, and snippets.

@roma-glushko
Last active April 14, 2016 11:51
Show Gist options
  • Save roma-glushko/399fd34235774ae24c35900471e2aa88 to your computer and use it in GitHub Desktop.
Save roma-glushko/399fd34235774ae24c35900471e2aa88 to your computer and use it in GitHub Desktop.
Update product attribute of Magento 1.x
<?php
$allProductIds = Mage::getModel('catalog/product')->getCollection()->getAllIds();
$attributeCode = 'some_eav_attribute';
$attrData[$attributeCode] = 'some_value';
$storeId = 0;
Mage::getSingleton('catalog/resource_product_action')->updateAttributes($allProductIds, $attrData, $storeId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment