I try to explain what I would like to do:

  • I created a new attribute called stockqty in Stores> Attributes> Products.
  • I assigned this attribute to the Default section and re-indexed everything
  • As a last step I have assigned a certain number of quantities for each product. Example: Product-X will be with "stockqty = 100", Product Y will be with "stockqty = 200" etc ...

When I go to the list page I dress that my attribute is correctly displayed in the layered navigation but not as I want:

enter image description here

In this filter I don't want to see the checkboxes but a single input text in which I put a quantity and after sending I would like to see the products that fall within the quantity that I wrote.

How can I accomplish this?

  • If I had to do something like this, I would use JavaScript to a) hide the default UI for this element, b) display the text input in its place, c) handle user input by matching it to the range of available (hidden) values and programmatically selecting the most appropriate, presumably, the first one that is greater than the users's requirement.
    – jiheison
    May 16 '21 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.