Show price filter without decimals

  • Posts: 65
  • Thank you received: 0
13 years 3 weeks ago #33927

Hello I am trying to show the price filter in my shop without decimals. as you can see her its with decimals
galeriadeartepedropena.com/tienda
I want it to show 500 instead of 500,00 (to many 0´s makes it confusing)
Do you know how to do this?

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
13 years 3 weeks ago #33962

Hi,

There is no option for that.
If you want to do that you will have to change the lines:
$formatVal=$currencyClass->format($formatVal,$currency);
if($key!=0){ $oldVal=$currencyClass->format($oldVal,$currency); }

by:
$formatVal=str_replace(',00','',$currencyClass->format($formatVal,$currency));
if($key!=0){ $oldVal=str_replace(',00','',$currencyClass->format($oldVal,$currency)); }

in the file administrator/components/com_hikashop/classes/filter.php
However, that is a core file of HikaShop so you will loose that modification when you update HikaShop.

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41099

Can't we accomplish this with a template override?

I just want the price shown without decimals, currency and the phrase "per unit".


Jan

Last edit: 12 years 10 months ago by jansuhr.

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41217

Mmm.
You can actually even if it's less nice.

edit the file "filter" of the view "product" via the menu Display->Views and change the line:
$html[$key]=$this->filterClass->displayFilter($filter, $this->params->get('main_div_name'), $this, $datas);

by:
$html[$key]=str_replace(',00',' per unit',$this->filterClass->displayFilter($filter, $this->params->get('main_div_name'), $this, $datas));

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41227

OK, but if I place that file in the HTML-folder of my templates it will not be affected of any future updates, right?


Jan

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41231

Do it via the interface and it will do that automatically. And yes you won't loose your changes when you update.

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41240

That is clever B)

Jan

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41245

I'm sorry but that change didn't take in effect, same look as before...


Jan

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41421

Make sure that the modification has been done in the file and that you edited to correct file (you will have one file per template on your website so you need to edit the one of the template you're using)

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41491

Yes I did edit the correct file for my template but it doesn't do any change.

I removed the edited file and redid the mod but it doesn't change.

Jan

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41624

Then try to unpublish the codemirror editor via the joomla plugin manager.
It can sometimes mess the saving of the modifications.

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41636

It didn't do any difference...


Jan

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41812

Then, I don't know.
Maybe joomla don't have write access to the folder where that override file needs to be written to ?
In that case, you should change the permissions of the folder templates/YOUR_TEMPLATE/html/com_hikashop/product to allow that.

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

  • Posts: 182
  • Thank you received: 15
12 years 10 months ago #41826

There is no problem with the permisions. I have done several overrides and they write OK. If I look in the file "filter.php" on the server with the changes are there. So the code that you suggested is there.

As it is at the moment the site is on my Mac under localhost. I will upload everything in a few days to my InternetHost, then you can take a look your self.

I can live with it for the moment, it is just cosmetic.

What's more important is this issue: www.hikashop.com/en/forum/4-how-to/41662...ing-in-listview.html


Jan

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #41862

If the change is in the file, I don't see why it doesn't work.

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

  • Posts: 1
  • Thank you received: 0
12 years 10 months ago #44167

Hi, im having the same issue, i want my productos to be shown with out the decimals, i check the advises on this Topic but, i dont seam to have that file on my site. With my ftp client im browsing to /administrator/components/com_hikashop/classes and i dont see any filter.php file
Can you advise me on this

Thanks

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 10 months ago #44180

This thread is only about prices in filters which are only in the Business edition of HikaShop, not for prices of products.

For the price of products, you just need to edit your currency via the menu System->Currencies and change the decimal option of your currency to what you want.

The following user(s) said Thank You: bodimau

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

Time to create page: 0.097 seconds
Powered by Kunena Forum