Jump to content

Disable round prices


Recommended Posts

  • 4 months later...
  • 4 weeks later...

Hi Nemo,

 

as you said, for example for this line of code : 

 

$product['total_wt'] = Tools::ps_round($product['total_wt'] - $product['price_wt'], (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

 

how will it be at the end ?

 

Regards,

Link to comment
Share on other sites

  • 1 month later...

I just thought that it might be enough to modify the core function and simply return the same content it's inputted, so you don't have to change every occurrence. THis way there will never be any rounding though

Hi !

 

In Prestashop 1.6. go into localization->Currencies. Pick up your currency and edit it. You need to enable decimal.

For Prestashop 1.5.x go into localization->Currencies. Pick up your currency and edit it. Please select appropriate Currency Format.

 

Thanks

 

Bhavesh

www.digitalmodule.net 

  • Like 2
Link to comment
Share on other sites

  • 3 months later...
  • 5 months later...

Hello,

 

Will you please elaborate on how to disable the rounding feature in the cart?

 

Which files need to be edited?

 

Will commenting out the line of code be sufficient?

 

How will this line of code look after it is edited? $product['total_wt'] = Tools::ps_round($product['total_wt'] - $product['price_wt'], (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

 

Rounding up the weight is fine because carriers will do this when they calculate the shipping cost. I only want to disable rounding up/down the product pricing and product discounts.

 

Thanks in advance for your reply.

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

Will you please elaborate on how to disable the rounding feature in the cart?

 

Which files need to be edited?

 

Will commenting out the line of code be sufficient?

 

How will this line of code look after it is edited? $product['total_wt'] = Tools::ps_round($product['total_wt'] - $product['price_wt'], (int)$currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);

 

Rounding up the weight is fine because carriers will do this when they calculate the shipping cost. I only want to disable rounding up/down the product pricing and product discounts.

 

Thanks in advance for your reply.

you can access admin. 

 

localization->currency ==>edit you currency(ex: dolla,vnd...)

then check at Decimals.

i'm sorry,my english very bad,

'.()

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

We have to disable rounding because we use prices like 35,37 Ft (Tax Excluded) but the presta show just 35 Ft.The customer see if he buy 100 pieces: 3537 Ft.

We think this is frustrating for the customers.

 

Can any one explain how to disable it in 1.6.1.4?

 

Thank you!

Link to comment
Share on other sites

  • 5 months later...

HI!

Is there a way to disable round price option in prestashop?

I want  prices stay stable without rounding in any direction at all.

 

Hello, did you find a solution for this?

Having the same problem...

Link to comment
Share on other sites

Some kind of rounding is inevitable, prices cannot display like 3.438593476958

 

Hello NemoPS,

I agree with you, but how do we explain the situation to the costumer?

 

In our case for ex:

 

Product A -> price per unit -> 1.38€ -> qtd 12 -> 16.56€

Product B -> price per unit -> 1.22€ -> qtd 6 -> 7.32€

 

 

Total should be 16.56€ + 7.32€ = 23.88€

We are getting 16.56€ + 7.32€ = 23.91€

 

Any advise on this?

Or how should it be configured to at least be as accurate as possible :(

 

 

Tks

Link to comment
Share on other sites

I understand your frustration. Unfortunately, rounding has always been an issue with prestashop. What I did in a few cases was going through the code, especially for PriceCalculation of the Product.php class, and remove all instances manually, then use it at the very end of the function

Link to comment
Share on other sites

I understand your frustration. Unfortunately, rounding has always been an issue with prestashop. What I did in a few cases was going through the code, especially for PriceCalculation of the Product.php class, and remove all instances manually, then use it at the very end of the function

 

Hummm.... Well, thanks for the feedback!

Since i'm not a programmer this will be an impossible task for me.

 

Thank you!

Link to comment
Share on other sites

  • 2 years later...

Hi,

I also have an issue with rounded numbers. Prestashop 1.7.6.1 using "Round up to nearest value" "Number of decimals: 0". 

In product pages the price is show ok, like 18,00. The problem is, when a client click "Add to cart" in the windows that pops-up, right under the item the not-rounded price is displayed. Then also in the email that the client receives with that table containing his order, the Prier per Unit is displayed as not-rounded price. And because of this we are still unable to go live with the shop. Anybody have any idea on how to fix this? Thanks 

Annotation 2019-11-09 231241.jpg

Link to comment
Share on other sites

  • 1 year later...

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...