Ezra Ezra - 5 months ago 11
MySQL Question

Where is the table that holds the "Special Price" in Magento?

Im trying to update the "Special_price" and "price" in bulk with mySQL an a php script, I know the table and row that contains the "price" but not the one that contains the "special_price".

I've looks though the database itself and still no luck. Any ideas? I need the table name and the field name.

Answer

My membership in the Magento Question Answers Guild requires me to suggest you work on fixing your API errors instead of using plain old SQL to update the database. As mentioned elsewhere, updating the database directly might put Magento into a state not recognized by the system, which can lead to strange, infuriating errors.

That said, the special price value will be stored with the other product attribute values in the

catalog_product_entity_decimal

table. This table has an attribute_id column, which has a foreign key relationship with the eav_attribute table. Look in the eav_attribute table for the attribute with the code special_price. That attribute_id and the product's entity_id should be enough to find the correct row in catalog_product_entity_decimal.

Keep in mind no row will exist if a product doesn't have a special_price set. Also keep in mind if a product has a special_price set at different scope levels that there may be more than one row.