Hi,
I was updating some prices in my shop and when i updated the price globaly in % i managed to add numbers such as 10,7%
This makes my prices show up like: 1890.47,- But i want round the price up so it shows 1891,- instead
How and where can i do this?
You can run the following queries in the phpMyAdmin
UPDATE ?:product_prices SET price = ROUND(price);
UPDATE ?:ult_product_prices SET price = ROUND(price);
(!) Do not forget to make a backup of these tables just in case
[quote name='eComLabs' timestamp='1435838470' post='221362']
You can run the following queries in the phpMyAdmin
UPDATE ?:product_prices SET price = ROUND(price);
UPDATE ?:ult_product_prices SET price = ROUND(price);
(!) Do not forget to make a backup of these tables just in case
[/quote]
Is it possible to determind what products to update?
Would this work?
UPDATE ?:product_prices SET price = ROUND(price) where description like @Name
UPDATE ?:ult_product_prices SET price = ROUND(price) where description like @Name
These tables do not contain descriptions only product_id. E.g.
UPDATE ?:product_prices SET price = ROUND(price) WHERE product_id = 123;
Once more, Thanks for the help eComLabs
Or if you really had to use description…
UPDATE ?:product_prices AS p
INNER JOIN ?product_descriptions AS pd ON pd.product_id = p.product_id AND pd.lang_code='en'
SET p.price = ROUND(price) where pd.description like '@Name'
Note: not tested
I would think most businesses would use the product_code instead of something from the descrition. In that case, it woulld look like:
UPDATE ?:product_prices AS p
INNER JOIN ?products AS pd ON pd.product_id = p.product_id
SET p.price = ROUND(price) where pd.product_code='[your code]'
This would also use indexes more efficiently since a LIKE statement will for a full table scan.
Versiyon 4.3.3
Rounding penny of
(.00) Rounds 2 decimal places
/app/functions/fn.common.php
Editor
Line: 819
Find
$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, $decimals));
Change
$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, 0));
Thanks for the input, but i found eComLabs answer to be the best way to do it for me.
Nothing complicated and since i dont use prices such as example 10.99,- or 10.49,- on any other items the query only affected the items i had messed up the prices on
[quote name=‘istanbul’ timestamp=‘1435889149’ post=‘221434’]
Versiyon 4.3.3
Rounding penny of
(.00) Rounds 2 decimal places
/app/functions/fn.common.php
Editor
Line: 819
Find
<br />
$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, $decimals));<br />
```<br />
<br />
[b]Change[/b]<br />
```php
<br />
$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, 0));<br />
```<br />
[/quote]<br />
<br />
Thank you Istanbul. This helped me get the .76 - .89 - .44 away <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)">
Turns out it did not like the code change Istanbul.
After the edit i get this error frontend.
[quote]Feil[color=white][font=Roboto]Oops, something is wrong (SyntaxError: Unexpected end of input). please try again[/font][/color][color=#465A6D][font=Roboto]
[color=#222222][/quote][/color][/font][/color]
[quote]Error Oops, something is wrong (SyntaxError: Unexpected end of input). Please try again.[/quote]
The error message comes up when i try to use the filter. Comes up even after i removed the change.
And not only that… It also messed up my webshop in the manner that i cant add items to shopping cart anymore.
Its loads for like 1 minutt and then the same error message comes up.
Does anyone have an idea how to fix this?