- Posts: 10
- Thank you received: 0
How to build a custom date range filter?
6 years 6 months ago #316710
by andiman
How to build a custom date range filter? was created by andiman
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.
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.
6 years 6 months ago #316712
by nicolas
Replied by nicolas on topic How to build a custom date range filter?
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.
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.148 seconds