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

18,848

Solution 1

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.

Solution 2

Special Price is an attribute of decimal type. First you need to get the attribute id, by applying this sql query: SELECT attribute_id FROM eav_attribute WHERE attribute_code='special_price';

Then, you can add a special price for any product by inserting a record into catalog_product_entity_decimal table.

Share:
18,848

Related videos on Youtube

Nicekiwi
Author by

Nicekiwi

Budding NodeJS Developer

Updated on August 03, 2022

Comments

  • Nicekiwi
    Nicekiwi over 1 year

    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.

  • zwol
    zwol almost 10 years
    This doesn't appear to answer the question that was asked, which is about changing special prices, not deleting them. Also, you should explain why this works and what the magic number 76 means (based on the other answers, I suspect it is only 76 in your database).