Jump to content

Catastrophic failure - Rounding prices to complete units


Recommended Posts

 

Hello mates,

 

I have a problem that is giving me headaches.

 

I currently use prestashop 1.6.06 and updated to 1.6.0.11 1 Click Automack prestashop.

After updating my template is not displayed well and decided to back down restoring files and database using the hosting.

 

It seems that all goes well, now the problem me all prices rounded to whole units but in the front office and backoffie as a list of products only. If you open the data sheet shown good.

 

For example a product worth 1.735537 + VAT 21% = € 2.10 but the site shows me 2 EUR

 

Happens that someone can help me?

 

Attached photos.

 

Thank You,post-615511-0-91769700-1421582328_thumb.jpgpost-615511-0-81010400-1421582329_thumb.jpgpost-615511-0-94152400-1421582330_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

To be precise:

 

Adding

define('_PS_PRICE_DISPLAY_PRECISION_', 2);

to config/defines.inc.php solves this problem. I updated from 1.6.0.9 to 1.6.0.11 and after that all prices incl. tax in FO/BO were whole numbers without decimals (BO settings - Number of decimals were ignored!).

Link to comment
Share on other sites

  • 11 months later...

Same issue... but unsolved

 

I upgrade from version 1.5.6 to 1.6.4

Everything worked fine then i had to modify define.inc.php file.

i had a blank page after refreshing so i uploaded back this file taken from the official prestashop folder on a fresh copy.

It worked again but all prices are rounded and integer...

 

when i save a (float)something.total_paid it save integer...

 

I tried to add define('_PS_PRICE_DISPLAY_PRECISION_', 2); line to define.inc.php

but it doesn’t fix the issue ...

 

on admin panel -> location -> devises decimals are set to 'yes'

 

what is going wrong ?

 

Thanks

 

EDIT: ok, mea culpa, i understood.

I was converting a string to a float number. (float)$myNumber ... the number was something like 0,00.

i replace comma by a point and it's fine now.

Edited by Fred93Nord (see edit history)
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...