VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: aravir on June 30, 2020, 14:19:53 PM

Title: Round total price
Post by: aravir on June 30, 2020, 14:19:53 PM
Hello,
is it possible to round total order price to integers? I know there is very complex section for rounding of product prices in virtuemart settings, but i didnt found rounding total price.
I need to round final product prices to 2 decimal place, which works fine, and total price to 0 decimal places (whitch i dont know how to set).

Example:
I have 2 products, each 2 pieces in cart, 1st one cost 22.29 and 2nd one cost 10.29.
Now total is 2*22.29 + 2*10.29 = 65,16
i need to round it to 65.

It has to be really rounded (not only front-end displayed number), because when customer pays online, i need him to pay exactly 65, not 65,16.

Thanks for help
Mojmír
Title: Re: Round total price
Post by: widcater on July 01, 2020, 06:13:15 AM
Hi,
      Basically,  You need to customize the codes of cart part  ,  But you still need to consider how to deal with the tax and shipping fee and make sure the invoice in backend is same fee .


Kevin
Title: Re: Round total price
Post by: aravir on July 14, 2020, 19:02:20 PM
Quote from: widcater on July 01, 2020, 06:13:15 AM
Hi,
      Basically,  You need to customize the codes of cart part  ,  But you still need to consider how to deal with the tax and shipping fee and make sure the invoice in backend is same fee .


Kevin

Thx for reply. We will manage, but i have hoped, there is existing solution. In this particular case, virtuemart invoices arent issue fortunately.

Actually i cant believe that there is not built-in feature for that. In Czech republic (and i believe in many other countries) its normal to have invoices (total price to be paid) rounded to integers (we even dont have coins/banknotes with value less then 1 Kč). For many B2C e-shops its fine to round product prices to integers as well, but for wholesale B2B e-shop selling many pieces of cheap products or e-shops with weighed goods etc., thats not possible.

I guess it would be better to be "core" function, is there possibility to add it somewhere as nice-to-have future feature?

Title: Re: Round total price
Post by: pinochico on July 14, 2020, 20:32:04 PM
I like the term nice-to-have future feature.
It sounds like 50 programming hours without an economic result, because one minority in the Czech Republic wants it

Make no mistake, there are many e-shops in the Czech Republic that sell in Euros and there, it is bad to round the total amount to whole numbers.
At the same time, there are many e-shops in the Czech Republic, where the creation of an invoice takes place outside the e-shop and payment by bank transfer.

You just want your insight.
We always deal with it as an override template. Try it too.