Filter product by height, length and width.

  • Posts: 10
  • Thank you received: 0
  • Hikashop Business
5 days 1 hour ago #371900

Hello,

I thought this would be really easy but I can't get it to work.

I want customers to be able to filter products by their height, length or width using the data from the product information, the fields just after the weight field on the backend product listing.

I tried creating a custom field label height and sql query:

select product_height from josii_hikashop_product

Along with numerous variations but nothing works.

I tried creating a new filter > Single drop down > Product Information > Height but this does nothing either.

Suggestions gratefully received.

Thanks!


Tolerence costs nothing.
Intolerance is intolerable!

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

  • Posts: 85611
  • Thank you received: 14024
  • MODERATOR
4 days 22 hours ago #371903

Hi,

The right combination for this is:

- Filter data: Product information
- Information: Height (or Length, or Width)
- Filter type: Cursor (the slider with two handles), not Single dropdown

The cursor filter auto-detects the min and max value from your catalogue's product_height / product_length / product_width columns and lets the customer drag the two handles to narrow the range. The SQL it generates is a simple BETWEEN on the corresponding product column.

The Single dropdown filter would have worked too but it expects you to predefine the ranges manually (for example 0-10 / 10-20 / 20-30), which is why nothing showed up when you tried it: with no ranges configured, the dropdown has no options to display.

You do not need a custom field for any of this. Height, Length and Width are core columns on the product table, and the Product information filter data reads them directly. Custom fields are for adding new columns to your products that do not already exist; using them to mirror an existing core column would create a duplicate that does not auto-populate.

As a bonus, the same Product information filter also has Surface and Volume options that compute width * length and width * length * height on the fly, so you can offer those as filters too if it makes sense for your catalogue.

The following user(s) said Thank You: The Wheaten Terrier

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

Time to create page: 0.050 seconds
Powered by Kunena Forum