Fragmented Thought

Find custom attributes on magento orders

By

Published

Lance Gliser

Heads up! This content is more than six months old. Take some time to verify everything still works as expected.

Need to find out what attributes changed from base in your magento install? The kind that aren't defined through the standard admin, meaning you've got a custom extension to deal with? Here's your search:

SELECT a.attribute_id, a.attribute_code, et.entity_type_id, et.entity_model, et.attribute_model, et.entity_table FROM eav_attribute a JOIN eav_entity_type et ON et.entity_type_id = a.entity_type_id WHERE a.is_user_defined = 1 AND et.entity_type_id IN ( SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code IN ( 'order', 'order_address', 'order_item', 'order_payment', -- Orders 'quote', 'quote_address', 'quote_address_rate', 'quote_address_item', 'quote_item', 'quote_payment', -- Quotes 'invoice', 'invoice_item', 'invoice_shipment', 'invoice_comment', -- Invoices 'shipment', 'shipment_item', 'shipment_comment', 'shipment_track', -- Shipments 'creditmemo', 'creditmemo_item', 'creditmemo_comment' -- Credit memos ) ) ORDER BY et.entity_model, a.attribute_code