Search code examples
prestashoplayered-navigation

How to search after input value that must be between two feature values in prestashop?


To understand it fully I will give a clear example:

Our webshop sells zip ties. Every zip ties can be tightened between a minimum and a maximum diameter. For example say from 0.5" to 2". In most of the cases the buyer needs a zip tie for a specific needed diameter. What we need is to have a possibility to get an input for the needed diameter and list all the zip ties where this input is between the minimum and maximum diameter.

I have tried different variations with layered navigation but it can not be done with it.

Any help is welcome.


Solution

  • You need to customize blocklayered module, some tips:

    let's imagine in shop each product have 2 different features "min diameter" and "max diameter" and you already created filter for them, checkboxes.

    • hide these blocks by display:none
    • add in template input field for the actual diameter value.
    • after customer's input, select all min/max checkboxes that satisfy the condition
    • call blocklayered method to send the filters.