Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

mysql

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.

like image 406
Nicekiwi Avatar asked Sep 20 '12 00:09

Nicekiwi


1 Answers

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.

like image 92
Alan Storm Avatar answered Nov 15 '22 14:11

Alan Storm