0

We use more than 1000 attributes in our Magento store, that all have the value is_comparable "yes".

I want to change this value to "no" for all attributes in my Magento store.

How can I achieve that, by using a file? Otherwise I need to edit 1000 attributes by hand.

2

You can run database query to make value no.

Or Just make script and add below code by all attribute id

require_once ('app/Mage.php');
umask(0);
Mage::app();

$attributes = Mage::getResourceModel('catalog/product_attribute_collection')->getItems();

foreach ($attributes as $attribute){

    $attributeId =  $attribute->getId();

    if ($attributeId) {
       $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
       $attribute->setIsComparable(0)->save();
   }
}
4
  • Thanks a lot! That script is complete and should work right away?
    – JGeer
    Jan 18 '17 at 7:36
  • @HenkZ see i have edit answer. now you can use this script in root by making php file
    – Kul
    Jan 18 '17 at 9:36
  • Thanks a lot! Do I need to enter a attribute ID or something or should it work right away?
    – JGeer
    Jan 18 '17 at 9:55
  • No required to add attribute id. it will take all product attribute of your store
    – Kul
    Jan 18 '17 at 9:58

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.