VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Siguana on December 29, 2018, 16:20:26 PM

Title: Prices rounded in a wrong way
Post by: Siguana on December 29, 2018, 16:20:26 PM
  I have Joomla! 3.9 and VirtueMart 3

  I have an item with a base price like 10.7355€

  Inside VirtueMart configuration, I stablished all prices with just 2 decimals.

  But, after setting the taxes rule (21%), I get a total price of 13€ instead of 12.99€.

  I have checked the coding and it seems that VirtueMart is calculating the total price from the rounded value of the base price, in this case, 10.74€ instead of 10.7355€.

  If I change the number of decimals inside configuration, for example 4 decimals, all these 4 decimals are displayed at frontpage, and the total price is correctly calculated, but I just want 2 decimals to be displayed.

  How should I do for getting the correct total price with just 2 decimals?
Title: Re: Prices rounded in a wrong way
Post by: jenkinhill on December 29, 2018, 23:34:20 PM
What have you set for Decimals (to display) on the Currency Details page for the Euro?  (Currencies uner Configuration)
Title: Re: Prices rounded in a wrong way
Post by: Siguana on December 30, 2018, 10:43:59 AM
It is set to 2 decimals
Title: Re: Prices rounded in a wrong way
Post by: jjk on December 30, 2018, 22:14:18 PM
You probably have to set the also the decimals of the 'Final sales price' to 2 in the VM 'Configuration' > 'Pricing' tab and set all the other 'Rounding Digits' to '-1'. The -1 means that these prices use the rounding set for the currency.
Title: Re: Prices rounded in a wrong way
Post by: Siguana on December 31, 2018, 12:45:20 PM
  I have tried with that, but it still returns a wrong value   :-\
Title: Re: Prices rounded in a wrong way
Post by: jjk on December 31, 2018, 13:07:02 PM
Which exact VirtueMart 3.x version do you use? Perhaps updating to a newer 3.4.2 or 3.4.3 version solves your problem. (Backup before the update).
Title: Re: Prices rounded in a wrong way
Post by: Siguana on December 31, 2018, 13:50:12 PM
I have VirtueMart 3.4.2 version (and that is the newest version if I am not wrong).
Title: Re: Prices rounded in a wrong way
Post by: jjk on December 31, 2018, 14:17:30 PM
When I tested your example on my PC yesterday, the price display was 12.99. Do you use 'Vat tax per product' in the tax calculation rule?
Title: Re: Prices rounded in a wrong way
Post by: Siguana on January 01, 2019, 12:07:55 PM
  Happy New Year!

  Yes, I am using 'Vat tax per product' in the tax calculation rule.  If it is not possible, I'll have to use 12.98 instead of 12.99, but of course, I prefer 12.99.
Title: Re: Prices rounded in a wrong way
Post by: jjk on January 01, 2019, 13:15:50 PM
I currently have no idea why it works in my case but not in yours.

Quote from: Siguana on January 01, 2019, 12:07:55 PM
I prefer 12.99.

I also have no idea why most sellers believe that a product for 12.99 sells better than a product for 13.00. Seems to be inherited from one generation to the next without anyone coming up with the idea of questioning it. I remember an experiment in large drugstores where all x.99 prices were rounded up to the full amount. It had no effect on the buying behaviour of customers.  :)
Title: Re: Prices rounded in a wrong way
Post by: GJC Web Design on January 01, 2019, 13:34:13 PM
what if u set your final price and use calc cost price?

Title: Re: Prices rounded in a wrong way
Post by: Siguana on January 02, 2019, 11:55:46 AM
  I have tried checking "Calculate the Cost Price".  After saving, it is unchecked and I am still getting 12.98   :o
Title: Re: Prices rounded in a wrong way
Post by: GJC Web Design on January 02, 2019, 13:31:00 PM
unchecked after save is correct..  do u get  10.73554 ? as cost?
Title: Re: Prices rounded in a wrong way
Post by: AH on January 02, 2019, 14:18:43 PM
@gjc is correct

Enter the final retail price you "Want" - check "calc cost price" and Save.

The system will store the Final price of 12.99 and the base price/cost price that the item would need to be in order to achieve the Final price with VAT tax of 21%

Title: Re: Prices rounded in a wrong way
Post by: Siguana on January 02, 2019, 15:32:29 PM
  These are the values that I get after saving, but at frontpage I get 13€

(https://res.cloudinary.com/saintseiya/image/upload/v1546439463/1_pitd6i.jpg)
Title: Re: Prices rounded in a wrong way
Post by: GJC Web Design on January 02, 2019, 16:42:51 PM
then u must be rounding your price display as your admin clearly shows 12.99