May 19, 2011
Updating Product Attributes through the Magento Database
By DineEngine

Ever wonder how change the page layout of all your products in Magento through the admin back-end with one fell swoop? I did recently and came to the conclusion that you can’t. The only option is to make changes directly to the database, which seems simple enough. However, to a developer that is fairly new to Magento, understanding the Entity, Attribute, and Value (EAV) database architecture can be slightly daunting. Fortunately there are numerous articles out there offering guidance on this topic. I found this tutorial to be particularly helpful.

This is the basic process to follow when looking for product attributes within the database:

1) Find out what the entity_type_id is for products.

SELECT * FROM catalog_product_entity WHERE 1;

2) Using the entity_type_id for products, you can now obtain a list of attributes for a given product.

SELECT * FROM eav_attribute WHERE entity_type_id=10;

3) If you are looking for a particular attribute to change, take note of the corresponding attribute_id. In my case, page_layout with id 929.

4) Lastly, depending on what field type that attribute may be (varchar, text, decimal, etc.) update your product attributes in the corresponding catalog_product_entity table to the new desired value!

UPDATE catalog_product_entity_varchar SET value="new page layout" WHERE attribute_id=929;

DineEngine Staff members delight our subscribers and guests with interesting takes on what's going on in the restaurant industry with a focus on food technology and industry events.

2 Comments

  1. Jey

    good info

    Reply
  2. thxforthis

    thx for this

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Get Started with DineEngine.

Contact Us Now Find Out How Chepri Can Help Your Team. Ask Us More About Updating Product Attributes through the Magento Database.

(800) 338-8102

733-C Lakeview Plaza Blvd. Worthington, OH 43085.