cancel
Showing results for 
Search instead for 
Did you mean: 

Table update

Table update

Hello

 

I need to do a product price update directly into de database, im trying to sql-query "mp_catalog_product_index_price" table

 

update mp_catalog_product_index_price_tmp set price=15, final_price=15, max_price=15, min_price=15 WHERE entity_id = (select entity_id from mp_catalog_product_entity where sku like SKU1');

 

and the price changes if cache is disbled, but after 3-5 min price goes to "0.0" automatically, Someone knows why it happends? Could it be because is magento charging the prices from another table?

 

Regards

6 REPLIES 6

Re: Table update

Hi @franting 

 

Well this is why you shouldn't do dirrect SQL queries in the DB ;-)

 

The table you are looking at is part of the indexed data structure, meaning that you are not upadting the permenant price just the indexed data.

 

If you insist on writing dirrectly in the DB. You are looking for the table called:

 

catalog_product_entity_decimal

 

You need to find your out what attribute_id you price label is. 

 

I hope this helps :-)

Re: Table update

Tnks for your answer Theis

 

I am updating values in this tables:

 

-mp_catalog_product_index_price

-mp_catalog_product_index_price_tmp

-mp_catalog_product_entity_decimal

 

 

But i am still having the same problem 

Re: Table update

Hi @franting 

 

Are you just checking the frontend for results, or are you also checking in the backend of the system. You could have a some sort of rule overwriting what you are doing. Or another script updating the price.

Re: Table update

Im checking frontend, backend, and mysql database and  data only survive to the first minute in the "mp_catalog_product_entity_decimal" table and with cache enabled never appears in frontend and backend.

 

I think i dont have any kind of script updating the price but i will try it in magento fresh instalation.

 

 

Re: Table update

You should not update prices in "index" tables - they may and will be overwritten with values from "permenant" tables sooner or later.

 

If you have to update prices with SQL query - then update values in `catalog_product_entity_decimal` table. After running query and updating values in there, new prices should appear in backend. If they do - run re-index, clear cache and check result on front-end.

-------Store Manager for Magento 1.x and 2.x - enhances the functionality of default admin web interface, speeds up inventory management, automates daily tasks.

Re: Table update

Hi @franting 

 

The data from catalog_product_entity_decimal will never apear in the frontend, becaouse its the actual value products price value. The price value showed in the frontend is the indexed value. Which is accumilated form different plances, like, Price, Special Price, Group price, Tier Price, Catalog Rules etc. As mentioned before you must have some sort of other value conflicting with what you are writing to this table which is why when the indexer updates the index table, which again you should not edit you self.

 

You have to go about checking the system for alternativ prices that could affect this like store speficic changes to the price or rules of some sort.

 

I hope this helps :-)