Jump to content

Add custom product field to ps_facetedsearch layered filter block


Recommended Posts

Hello,
- I made a custom field `field_custom` to `{prefix}_product` tables and Product ( ObjectModel ) classes.

 

How could I, add this `field_custom` searchable and also available to layered navigation filter or integrate with module ps_facetedsearch ?

for reference i have added image as attachment

- is there any hook available for extending this functionalities?

- if no hook available, is there code fixing solution available there?

My steps for already , trying to catch the solution:

-  modified in  ps_facetedsearch.php , in function rebuildLayeredStructure()  added field_custom to {prefix}_layered_category tables `type` field enum type value

- in function , buildLayeredCategories()  added another conditions layered_selection_field_custom_slider in $sqlInsert 

- in src/Filters/Block.php  added new switch case field_custom and made a function getFieldCustomRangeBlock()

now i stuck here.

any help will be appreciated.

thank you.

requirement.png.8b295099c1f026eefc607b8d6e05dd7b.png

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Thank you, for query , i provided the file of ps_facetedsearch with attachments. before install and enable this plugin you have to

add two custom fields km  and immatriculation_year  and put some data there.

on products table

and don't forget to rename the previous ps_facetedsearch to see in action to take side effects.

also don't forget to clean cache , indexing the product etc.

ps_facetedsearch.zip

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...