How to build a custom date range filter?

  • Posts: 6
  • Thank you received: 0
  • Hikashop Business
1 week 2 days ago #316710

Hello,

I dont need the complete way,. but where are the actual filters located? Where to find the "Cursor" filter and how to build a new one that is not overwritten when Hikashop is updated.

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

  • Posts: 68452
  • Thank you received: 10203
  • MODERATOR
1 week 1 day ago #316712

Hi,

You have basically two files :
administrator/components/com_hikashop/classes/filter.php contains the PHP for each type of filter.
administrator/components/com_hinkashop/types/filter.php contains the list of available filter types.
I think you could add your own filter type class via a system plugin (so that it is loaded with the onInitialise trigger of Joomla), and then implement the onFilterTypeDisplay trigger to add your own type to the list.
You'll need to implement two main functions in your filter type class, the "display" function to display the filter and the "addFilter" function to add additional conditions to the MySQL query loading the products on the frontend based on the data selected by the customer in your filter.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum