0

I have a Magento store with products count 70,000 approx. I want to update 5 custom attribute's value for all products.

I have a CSV file which contains SKU and value of custom attributes for all products. Is there any option available to update/set value for all text types attribute either using MySQL query or programmatically?

Thank you.

  • You can try magmi, it's much faster than default import functionality. – Jimit Bhavsar Aug 3 '18 at 5:50
  • As an idea, I would create a shell script , where I should do the update logic in batches . – Attila Naghi Aug 3 '18 at 13:56
0

This should give you an idea for how to run a script to perform a mass update on your products.

/*
 * Script to update custom attributes product values
 */

$_productCollection=Mage::getModel('catalog/product')
                    ->getCollection()
                    ->addAttributeToSelect('*');
$storeId=0;

foreach($_productCollection as $_product)  {
    $product = Mage::getModel('catalog/product')->load($_product->getId());   
    $data=array(
                'custom_attribute_1' = 'VALUE_OF_ATTRIBUTE1',
                'custom_attribute_2 '= 'VALUE_OF_ATTRIBUTE2',); 
    Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->getId()), $data, $storeId); 
}

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.