[Skip to main content](#vessel-content)

#   How to filter on min. age and max. age?

##

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#193500](#193500) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#193500 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")* was created by *[appletree](/forum/user/35813-appletree "View appletree's Profile")*

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Firefox 35.0.1
-- Error-message(debug-mod must be tuned on) -- : no errors

I use a filter with minimum age and maximum age, both can be between 4...18 year.
**Example:** A product is used for ages between 9 and 14 so these ages are set as custom fields.
When a shopper is filtering on min age= 9 and max age =15 he will ***not*** see this product.
He will only see this product if he filters on the *exact* numbers (9 and 14).
This is not what a shopper expects.

I want to show this product also if he filters from 4 to 10 or from 12 to 18.
Is this possible? How?
Which php file do I have to change?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 8 months ago [\#193543](#193543) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#193543 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hi,

Please give us a screenshot of the settings of your filter.
Are you using a cursor filter ? It seems to be indicated in your case.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#193830](#193830) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  Replied by *[appletree](/forum/user/35813-appletree "View appletree's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#193830 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hello Xavier,
In the original VM webshop they used a dropdown for minimum age and maximum age, so I did this als o in Hikashop.
See pictures.

- [ ![filter1.jpg](/forum/attachment/22925) ](/forum/attachment/22925 "filter1.jpg") [ ](/forum/attachment/22925?download=1 "filter1.jpg")
- [ ![filter2.jpg](/forum/attachment/22926) ](/forum/attachment/22926 "filter2.jpg") [ ](/forum/attachment/22926?download=1 "filter2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 8 months ago [\#193853](#193853) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#193853 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hi,

Yes this filter allow to filter on one value, to filter on a range, you can potentially use a multidropdown, or the cursor filter.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#194461](#194461) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  Replied by *[appletree](/forum/user/35813-appletree "View appletree's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#194461 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hello Xavier,
I have tested the multidropdown, thats nice, but not the solution.
In my database I have only a minumum age and a maximum age. The filter works exact, and that is not working for a customer.

Example: I have a childrens book suitable for 6 to 10 years. (In my database is min age= 6 and max age = 10)
The customer has a kid from 8 years. He would check on min age 7 and max age 9, the book will not show up, because you have to insert the exact min. age and max. age numbers.
And if the customer filters on min age 6 and max age 8 he also do not find the book.

I am still thinking about a right solution and will ask my customer (the webshop owner) her opinion.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#194462](#194462) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  Replied by *[appletree](/forum/user/35813-appletree "View appletree's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#194462 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hello Xavier,

What will be a good solution for products whitch are mentioned for a certain age group like children (example: 6-10 years)
So, what do you suggest to solve this problem?

The min age and max age is not a good solution as exact numbers in the database, because of the exact match you need. One field with 'age' could be a solution?

I like the cursor type (4..18 years) But how do I put a value (age - example: 6-10 years) in Hikashop to a product?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#194483](#194483) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  Replied by *[appletree](/forum/user/35813-appletree "View appletree's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#194483 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hello Xavier, I do have a solution, but it is not working OK.
This is what I do:

I made a new custom field 'leeftijd' (age) and put all values in it (see screenshot)
I also made a new filter of the type: cursor (4..18)
It looks if it works fine, but not always.
I have product A (7-12) and product B (7-15)
If I filter between 7 to 15 I will see both products, that's OK.
But if I filter between 8 and 15 I do not see any products.
Do I filter between 6 and 15 I will see both products, that's OK.

It seems Hikashop filter needs the lowest value you have entered in custom-field.
**So I think this is a bug.**

- [ ![leeftijd-filter2.jpg](/forum/attachment/23061) ](/forum/attachment/23061 "...jd-filter2.jpg") [ ](/forum/attachment/23061?download=1 "...jd-filter2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 8 months ago [\#194463](#194463) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#194463 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hi,

You will need two cursors, one for the min age and one for the max age.
If you set them as dynamic, so when filtering on one of the two values it will adapt the values available for the other cursor.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[appletree](/forum/user/35813-appletree "View appletree's Profile")**
- [![appletree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35813-appletree "View appletree's Profile") Topic Author
- [ Offline](/forum/user/35813-appletree)

Less More

- Posts: 41
- Thank you received: 1
-
-

11 years 8 months ago [\#195123](#195123) by [appletree](/forum/user/35813-appletree "View appletree's Profile")  Replied by *[appletree](/forum/user/35813-appletree "View appletree's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#195123 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hi Xavier,
I have tested with 2 cursors: 1 for min age and 1 for max age and both dynamically. The result is very strange, because the values above the cursors are changing, it should always be from 4...18 years. So this is not working.
My solution with one cursor and all ages in one custom-field (age) looks like the best for the web-visitor.
But the filtering is not working good.

Because this is important for the webshop, I need a solution. (The VM webshop from my customer has this solution... and I suggested to move to Hikashop.... :huh: ) I will ask it in a JUG.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 8 months ago [\#195180](#195180) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[How to filter on min. age and max. age?](/forum/45-filters-search/875469-how-to-filter-on-min-age-and-max-age#195180 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.29 -- Browser(s) name and version -- : Firefox 35.0.1 -- Error-message(debug-mod must be tuned on) -- : no errors  I use a filter with minimum age and maximum age, both can be between 4...18 year. Example: A product is used for ages between 9 and 14 so these ages are set as custom fields. When a shopper is filtering on min age= 9 and max age =15 he will not see this product. He will only see this product if he filters on the exact numbers (9 and 14). This is not what a shopper expects.  I want to show this product also if he filters from 4 to 10 or from 12 to 18. Is this possible? How? Which php file do I have to change?")*

Hi,

You have to disable the "dynamic" option then.
This way the values will always stay 4 ... 18

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg3NTQ2OS1ob3ctdG8tZmlsdGVyLW9uLW1pbi1hZ2UtYW5kLW1heC1hZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.072 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
