News:

Looking for documentation? Take a look on our wiki

Main Menu

Prices rounded in a wrong way

Started by Siguana, December 29, 2018, 16:20:26 PM

Previous topic - Next topic

Siguana

  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?

jenkinhill

What have you set for Decimals (to display) on the Currency Details page for the Euro?  (Currencies uner Configuration)
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Siguana


jjk

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.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Siguana

  I have tried with that, but it still returns a wrong value   :-\

jjk

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).
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Siguana

I have VirtueMart 3.4.2 version (and that is the newest version if I am not wrong).

jjk

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?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Siguana

  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.

jjk

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.  :)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

GJC Web Design

what if u set your final price and use calc cost price?

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Siguana

  I have tried checking "Calculate the Cost Price".  After saving, it is unchecked and I am still getting 12.98   :o

GJC Web Design

unchecked after save is correct..  do u get  10.73554 ? as cost?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

@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%

Regards
A

Joomla 3.10.11
php 8.0

Siguana

  These are the values that I get after saving, but at frontpage I get 13€