Jump to content

Run Sql query to round prices


Kolopsia

Recommended Posts

Hello,

 

I need to run sql query to round prices, around 5000 products its causing dismatch in google shopping and i have to fix this.

example of current prices:

320.48
1189.90
56.19

 

Prestashop version 1.6.11 and i do have access to phpmyadmin so just need the query. Thanks

Link to comment
Share on other sites

I have very few products with price impact depending on the attribute so that wont be a problem i just need to remove or round the decimals with a sql query, 

 

i tried this from other thread but it didnt do anything ?  Also tried it on ps_product_shop

 

UPDATE `ps_product` SET `price` = (SELECT (CEILING((`price`)*2)/2))

 

Link to comment
Share on other sites

49 minutes ago, Kolopsia said:

I have very few products with price impact depending on the attribute so that wont be a problem i just need to remove or round the decimals with a sql query, 

 

i tried this from other thread but it didnt do anything ?  Also tried it on ps_product_shop

 


UPDATE `ps_product` SET `price` = (SELECT (CEILING((`price`)*2)/2))

 

Hello,

PrestaShop was design price field as a decimal number with the decimals 6 numbers. And the price it should be like this number.xxxxx. So in this case the best solution is process from PHP or Javascript at front-end not database.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...