Bulk update products attributes to use the default value from All Store Views

On many occasions I see that, by mistake, the product attributes are set in both Store View and All Store View scopes. This causes a lot of issues to properly and effectively maintain the product catalogue in magento, often causing store owner to think they are changing the correct attribute values that will reflect on the frontend when they are actually not.

Also, when this is done all over the product catalogue manually updating all product to use only the All Store View values (by checking the Use Default Value checkboxes on the Store View scope) is not practical and very time consuming. Unfortunately Magento’s attribute bulk update process doesn’t allow to make this change. The only solution here is to perform this change directly on the database. Although changing the database directly is not a recommend process there is really no other way to do.

The solution is actually quite simple. You just need to delete all records from the store view that are stores on the catalog_product_entity_xxx tables. The SQL statements to run would be:

DELETE FROM `catalog_product_entity_text` WHERE `store_id`= X;
DELETE FROM `catalog_product_entity_varchar` WHERE `store_id`= X;
DELETE FROM `catalog_product_entity_int` WHERE `store_id`= X;
DELETE FROM `catalog_product_entity_decimal` WHERE `store_id`= X;

Where X is the store view id that you want to remove the values from.
There are also other tables that you might consider removing the values from and this same process can be done for category values as well.

Leave a Reply

Your email address will not be published.