Skip to main content

Round Price

More
11 years 5 months ago #200374 by florcar
Round Price was created by florcar
-- url of the page with the problem -- : www.fabulosa.ch
-- HikaShop version -- : HikaShop Business: 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.32

Hi

Is it possible to round the Price after a coupon, payment fee, etc. for example from 20.03 CHF to 20.05 CHF?

Thanks in advance
florcar

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200389 by nicolas
Replied by nicolas on topic Round Price
Hi,

Yes. Edit your currency via the menu System>Currencies and change the "Rounding increment" option to 0.05 and the system will round the elements by steps of 5 cents.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200487 by florcar
Replied by florcar on topic Round Price
Hi nicolas

Thanks for the answer. I changed it to 0.05 in the options of swiss franc. But unfortunately nothing happened. It still shows the price for example:
Product Price: 39.8 CHF
voucher: 10% = 3.98 CHF
Price=35.92 CHF

regards
florcar

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200495 by nicolas
Replied by nicolas on topic Round Price
Hi,

Please make sure that you have the "round prices during calculations" option turned on in the HikaShop configuration.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200569 by florcar
Replied by florcar on topic Round Price
Hi nicolas

If you mean in the main configuration under taxes, it is turned on.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200661 by florcar
Replied by florcar on topic Round Price
Hi nicolas

I would really appreciate you could help me with this.
Let me know if you need a login.

Regards

Florian

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #200856 by florcar
Replied by florcar on topic Round Price
Hello

I dont want to stress anybody. I know you have a lot of requests and the support is free and by the way awesome.
But this rounding Problem is a big issue on my site. So I would really appreciate any help :)

Regards
florcar

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #201220 by florcar
Replied by florcar on topic Round Price
Hello

Maybe the pictures in the attachement will show my problem more clear.

Regards
florcar
Last edit: 11 years 5 months ago by florcar.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #202055 by florcar
Replied by florcar on topic Round Price
No help? :(

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #202240 by nicolas
Replied by nicolas on topic Round Price
Hi,

Sorry for the delay. Such calculations issue is quite complex to debug so it took quite some time to debug, analyze and fix, and the French JoomlaDay was also in the middle...
Here is a zip with two files with the several fixes that were needed to fix that.
You'll need to replace them in the folder administrator/components/com_hikashop/classes/
Please make a backup of the original files in case there is a problem as these are complex changes and even though I did test them, it doesn't mean that I was able to cover all the edge cases.

This attachment is hidden for guests.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #202250 by florcar
Replied by florcar on topic Round Price
Hi Nicolas

Thanks a lot for the solution and the efforts. And dont worry for the delay.
I replaced the attached files and it seems to work for the discounts. But unfortunately it has no effect on the payment fees. See attached Image.

Regards

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago - 11 years 5 months ago #202331 by nicolas
Replied by nicolas on topic Round Price
Hi,

Ah yes, here are the files to put in the same folder to fix it for the payment fees.

This attachment is hidden for guests.
Please log in or register to see it.
Last edit: 11 years 5 months ago by nicolas.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #202352 by florcar
Replied by florcar on topic Round Price
Hi nicolas

The problem still exists on the listing of the final price. The payment fee is correctly rounded in the "Choose the payment method" but unfortunately not at the final price :blush:
See attached image.

Regards
florcar

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #202353 by nicolas
Replied by nicolas on topic Round Price
Hi,

Mmmm. I don't have the issue on my end.
Try to change the line:
$paymentData->payment_price = ($price_all * (float)@$paymentData->payment_params->payment_percentage / 100) + $paymentData->payment_price;

to:
$paymentData->payment_price = $currencyClass->_round(($price_all * (float)@$paymentData->payment_params->payment_percentage / 100) + $paymentData->payment_price,$currencyClass->getRounding($currency,true));;

in the file components/com_hikashop/controllers/checkout.php and see if that helps.

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #202435 by florcar
Replied by florcar on topic Round Price
Hi

No, it didnt change anything :blush:
I think you have one semicolon too much in your code. I tried both but it didnt work anyways.

Regards

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago - 11 years 4 months ago #202453 by nicolas
Replied by nicolas on topic Round Price
Hi,

Try like this instead:
$paymentData->payment_price = $currencyClass->_round(($price_all * (float)@$paymentData->payment_params->payment_percentage / 100) + $paymentData->payment_price,$currencyClass->getRounding(hikashop_getCurrency(),true));

If that still doesn't help, please provide a FTP access to your website via our contact form with a link to this thread so that we can directly look at the problem because we're shooting in the dark like that.
Last edit: 11 years 4 months ago by nicolas.
The following user(s) said Thank You: florcar

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #202523 by florcar
Replied by florcar on topic Round Price
Hi Nicolas

Now it seems to work :) -> Problem solved
Thank you for your great support.

Regards

Please Log in or Create an account to join the conversation.

Time to create page: 0.238 seconds
Powered by Kunena Forum