Round prices.... but only those above €5,-

  • Posts: 117
  • Thank you received: 6
10 years 2 months ago #194039

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : all

Good morning all

Is it possible to NOT round prices below €5,00 to the nearest 5c and DO it with amount over €5,00

I want round prices like 29,95 but not round prices like 1,79. I want these to stay as they are

something needs to happen around here, I feel:
administrator/components/com_hikashop/classes/currency.php

But what exactly?

Greetz

Dick

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #194096

Hi,

You could potentially edit the function _round() and add:

		if($price >= 5)
			$config->set('round_calculations',1);
		else
			$config->set('round_calculations',0);
at the top of the function.

The following user(s) said Thank You: Formidog

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

  • Posts: 117
  • Thank you received: 6
10 years 2 months ago #194261

Great to get an answer from you, Xavier!
I hope it will work for others too!

Thanks a lot.

I choosed not to hack Hika and keep the core clean.
Because I fill the tables thru FileMaker thru ODBC i opted to script the prices with a Filemaker Function. This works fine too.

Thanks for your replay anyway.
I have to say, coming from VirtueMart, it took me 3 webshops to become friends with HikaShop.
Especially the way HikaShop works with "associated menu's and modules". At first this is rather confusing, when you see the list of menu's and modules growing.

Everyday we live, we learn!

Greetz,
Dick

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

Time to create page: 0.066 seconds
Powered by Kunena Forum