FIlter override

  • Posts: 12
  • Thank you received: 0
  • Hikashop Multisite
6 years 3 days ago #291377

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.0.29
-- Browser(s) name and version -- : FireFox 59.0.2

Hello, I need to override the product filter output. I need the functionality of the checkbox, but the output needs to be as the cateogry images on which I am filtering. Is there a way to override the filter output?

I found the view file /product/filter.php but this takes fully formatted output form somewhere else. IN other words, I can not override the output in the view file.

What file(s) do I need to modify (and where in those file(s)) in order to output the category images as filter checkboxes?

Thanks in advance,

Erik

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

  • Posts: 81508
  • Thank you received: 13064
  • MODERATOR
6 years 3 days ago #291379

Hi,

The code displaying each filter is located in administrator/components/com_hikashop/classes/filter.php
So you could indeed modify that file directly.
However, you can probably do what you want in the product/filter.php view file with an override.
It's true that the HTML is already generated in the classes/filter.php file, however, you can modify the generated HTML with either str_replace or preg_replace.
That would allow you to not hav to reapply your changes each time you update HikaShop.

The following user(s) said Thank You: E. van Doorne

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

  • Posts: 12
  • Thank you received: 0
  • Hikashop Multisite
6 years 3 days ago #291392

Thank you Nicalos for that answer. Modifying the the generated HTML is an option, but maybe not entirely. I need to add the category images to the HTML and htat would require fetching those form the database table(s). It makes more sense to do that before the HMTL is generated and fetching input form the database is not something that should normally be done in the view file.
But your point is practical and that's OK too.

Thanks for the input and I'll look into what will be the most practical solution.

Erik

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

Time to create page: 0.063 seconds
Powered by Kunena Forum