- Posts: 17
- Thank you received: 0
Wrong Calculation of Total Price
12 years 6 months ago #147124
by asator
Wrong Calculation of Total Price was created by asator
-- url of the page with the problem -- :
www.tympanusforte.de
-- HikaShop version -- : HikaShop Essential: 2.3.0
-- Joomla version -- : 3.2.2 Stable
-- PHP version -- :5.3.3-7
Hey there,
i have seen other topics with the same issue but i wanted to stay out because mine is a little bit different.
So here´s the thing: In some cases, the total of al products is missing 1 cent. Thats pretty weird, because it only happens with some products.
On my page go to the shop and add 3 "Ticket Requiem Sitzplatz" to the cart, then the total price is 125,99 €, instead of 126€. But if you only add 2 tickets to the cart the price is displayed correct.
This will not happen if you choose the Stehplatz Ticket, on this product it is allright.
To confuse me even more, the wrong price with the 1cent offset is shown to the users when they pay, in the backend, on the invoice BUT NOT in the e-mail the user receives when he buys something.
I have tried to change some .php files like described in this post: www.hikashop.com/forum/3-bug-report/8659...correct-on-site.html but it doesnt help.
could it be something with the tax calculation? it it pretty weird that the price of the product without taxes has 6 numbers after the comma, like 39,56443 could this be the problem?
Thanks to you all,
Frank
-- HikaShop version -- : HikaShop Essential: 2.3.0
-- Joomla version -- : 3.2.2 Stable
-- PHP version -- :5.3.3-7
Hey there,
i have seen other topics with the same issue but i wanted to stay out because mine is a little bit different.
So here´s the thing: In some cases, the total of al products is missing 1 cent. Thats pretty weird, because it only happens with some products.
On my page go to the shop and add 3 "Ticket Requiem Sitzplatz" to the cart, then the total price is 125,99 €, instead of 126€. But if you only add 2 tickets to the cart the price is displayed correct.
This will not happen if you choose the Stehplatz Ticket, on this product it is allright.
To confuse me even more, the wrong price with the 1cent offset is shown to the users when they pay, in the backend, on the invoice BUT NOT in the e-mail the user receives when he buys something.
I have tried to change some .php files like described in this post: www.hikashop.com/forum/3-bug-report/8659...correct-on-site.html but it doesnt help.
could it be something with the tax calculation? it it pretty weird that the price of the product without taxes has 6 numbers after the comma, like 39,56443 could this be the problem?
Thanks to you all,
Frank
Please Log in or Create an account to join the conversation.
12 years 6 months ago #147148
by Eliot
Replied by Eliot on topic Wrong Calculation of Total Price
Hi Frank,
This is indeed probably something linked to the tax calculation.
If you have price with 3 digit after the dot or even 2 digit but a tax with decimals as well, then the calculation will give results like xx.xxx which have to be displayed like xx.xx
So what you can do is play with the options in the configuration to round the prices so the calculation will be rounded and you shouldn't encounter this issue.
This is indeed probably something linked to the tax calculation.
If you have price with 3 digit after the dot or even 2 digit but a tax with decimals as well, then the calculation will give results like xx.xxx which have to be displayed like xx.xx
So what you can do is play with the options in the configuration to round the prices so the calculation will be rounded and you shouldn't encounter this issue.
Please Log in or Create an account to join the conversation.
12 years 6 months ago #147219
by asator
Replied by asator on topic Wrong Calculation of Total Price
thanks eliot,
i tried to unmark the rounding option in the config but this wouldnt help. The rounding option was on when this problem first came up.
Is there a way to change the count of the decimals? to only have 2 or 3?
i tried to unmark the rounding option in the config but this wouldnt help. The rounding option was on when this problem first came up.
Is there a way to change the count of the decimals? to only have 2 or 3?
Please Log in or Create an account to join the conversation.
12 years 6 months ago #147336
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Wrong Calculation of Total Price
Hi,
When the option "round prices during calculiations" is on, the number of digits will be fix.
The rounding function have a default value of 2 digits. It can use the value of the currency configuration.
To change it I guess that the best will be to edit directly the class price file.
I have to admit that Nicolas is the expert of this part but he is currently in the Joomla day in Copenhagen.
Regards,
When the option "round prices during calculiations" is on, the number of digits will be fix.
The rounding function have a default value of 2 digits. It can use the value of the currency configuration.
To change it I guess that the best will be to edit directly the class price file.
I have to admit that Nicolas is the expert of this part but he is currently in the Joomla day in Copenhagen.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
12 years 6 months ago #147748
by asator
Replied by asator on topic Wrong Calculation of Total Price
hey,
the problem is not, that the rounding option uses 2 digits, but the price without taxes has 5 digits. To get the total of the order hikashop calculates with this price, so at the end i get this 1cent offset, is nicolas back from the Joomla day?
the problem is not, that the rounding option uses 2 digits, but the price without taxes has 5 digits. To get the total of the order hikashop calculates with this price, so at the end i get this 1cent offset, is nicolas back from the Joomla day?
Please Log in or Create an account to join the conversation.
12 years 6 months ago #148587
by nicolas
Replied by nicolas on topic Wrong Calculation of Total Price
Hi,
HikaShop will always store the prices with 5 decimals if the "round prices during calculations" option is turned off. If it's turned on, it will round the prices to 2 decimals (if that's how your currency is configured) and save these rounded prices in the database.
I checked on my end but the display is always consistent between the emails, the invoice, the checkout, etc.
Please make sure that you try for a new order when you change the option because you won't see the change for existing orders.
Maybe that could explain your situation ?
regarding the other thread you mentioned, it was about rounding issues with coupon calculations. So if won't change anything if you don't have any coupon applied to your order. There are no rounding issue with product prices calculations as far as I could test and no one else reported such issue so far.
HikaShop will always store the prices with 5 decimals if the "round prices during calculations" option is turned off. If it's turned on, it will round the prices to 2 decimals (if that's how your currency is configured) and save these rounded prices in the database.
I checked on my end but the display is always consistent between the emails, the invoice, the checkout, etc.
Please make sure that you try for a new order when you change the option because you won't see the change for existing orders.
Maybe that could explain your situation ?
regarding the other thread you mentioned, it was about rounding issues with coupon calculations. So if won't change anything if you don't have any coupon applied to your order. There are no rounding issue with product prices calculations as far as I could test and no one else reported such issue so far.
Please Log in or Create an account to join the conversation.
12 years 6 months ago #148638
by asator
Replied by asator on topic Wrong Calculation of Total Price
Hey nicolas,
could you try my error on the page i reported on? (tympanusforte.de)
You see the error in the shopping cart when you add three "Ticket Requiem Sitzplatz", then the price shown is 1 cent below
could you try my error on the page i reported on? (tympanusforte.de)
You see the error in the shopping cart when you add three "Ticket Requiem Sitzplatz", then the price shown is 1 cent below
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 5 months ago #153568
by Mohamed Thelji
Replied by Mohamed Thelji on topic Wrong Calculation of Total Price
Hello,
I tried to reproduce the issue through your website but I didn't found any "Ticket Requiem Sitzplatz" product, do you still have that issue ?
I tried to reproduce the issue through your website but I didn't found any "Ticket Requiem Sitzplatz" product, do you still have that issue ?
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds