Round Price

  • Posts: 62
  • Thank you received: 1
9 years 7 months ago #200374

-- 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.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #200389

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #200487

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.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #200495

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #200569

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #200661

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #200856

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #201220

Hello

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

Regards
florcar

Attachments:
Last edit: 9 years 6 months ago by florcar.

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

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #202055

No help? :(

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #202240

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.

File Attachment:

File Name: currency_2...5-20.zip
File Size:24 KB

Attachments:

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

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #202250

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

Attachments:

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #202331

Hi,

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

File Attachment:

File Name: payment_20...5-20.zip
File Size:22 KB

Attachments:
Last edit: 9 years 6 months ago by nicolas.

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

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #202352

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

Attachments:

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #202353

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.

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #202435

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.

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 6 months ago #202453

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: 9 years 6 months ago by nicolas.
The following user(s) said Thank You: florcar

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

  • Posts: 62
  • Thank you received: 1
9 years 6 months ago #202523

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.087 seconds
Powered by Kunena Forum