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

#   A Question about Filtering Variants

##

- **[evolution](/forum/user/8324-evolution "View evolution's Profile")**
- [![evolution's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8324.png)](/forum/user/8324-evolution "View evolution's Profile") Topic Author
- [ Offline](/forum/user/8324-evolution)

Less More

- Posts: 35
- Thank you received: 0
-
-

14 years 3 months ago [\#60717](#60717) by [evolution](/forum/user/8324-evolution "View evolution's Profile")  *[A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60717 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")* was created by *[evolution](/forum/user/8324-evolution "View evolution's Profile")*

I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.

The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.

For example, if the online customer followed category “\Footwear\Men\Casual”, they would only see sizes 38-47, if they followed “\Footwear\Women\Casual”, they would only see 34-40 (notice that there is an overlap). Categories “\Footwear\Girls\Casual” and “\Footwear\Boy\Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).

The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.

Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

14 years 3 months ago [\#60788](#60788) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60788 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")*

Hi,

You can unset unwanted variants in the "product &#124; show" view.
At the beginning of the file you can parse the product variants depending the current category (based on the pathway or the menu) and remove from the object variants which are not compatible.
The configuration won't be impacted, it would be like a filter before displaying the product.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[evolution](/forum/user/8324-evolution "View evolution's Profile")**
- [![evolution's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8324.png)](/forum/user/8324-evolution "View evolution's Profile") Topic Author
- [ Offline](/forum/user/8324-evolution)

Less More

- Posts: 35
- Thank you received: 0
-
-

14 years 3 months ago [\#60806](#60806) by [evolution](/forum/user/8324-evolution "View evolution's Profile")  Replied by *[evolution](/forum/user/8324-evolution "View evolution's Profile")* on topic *[Re: A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60806 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")*

Thanks Jerome,

Where is the "product &#124; show" view? I don't see "show" as a menu option under "products" menu.

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

14 years 3 months ago [\#60807](#60807) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60807 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")*

Hi,

How to change a view in HikaShop ?
[ www.hikashop.com/en/support/documentatio...-faq.html#pagination](http://www.hikashop.com/en/support/documentation/106-faq.html#pagination)

View listing documentation
[ www.hikashop.com/en/support/documentatio...op-view-listing.html](http://www.hikashop.com/en/support/documentation/integrated-documentation/43-hikashop-view-listing.html)

View edition documentation
[ www.hikashop.com/en/support/documentatio...ashop-view-form.html](http://www.hikashop.com/en/support/documentation/integrated-documentation/44-hikashop-view-form.html)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[evolution](/forum/user/8324-evolution "View evolution's Profile")**
- [![evolution's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar8324.png)](/forum/user/8324-evolution "View evolution's Profile") Topic Author
- [ Offline](/forum/user/8324-evolution)

Less More

- Posts: 35
- Thank you received: 0
-
-

14 years 3 months ago [\#60808](#60808) by [evolution](/forum/user/8324-evolution "View evolution's Profile")  Replied by *[evolution](/forum/user/8324-evolution "View evolution's Profile")* on topic *[Re: A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60808 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")*

Thanks Jerome,

I understand now. I need to edit the PHP to do what I want.

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

14 years 3 months ago [\#60809](#60809) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: A Question about Filtering Variants](/forum/2-general-talk-about-hikashop/60717-a-question-about-filtering-variants#60809 "I have a client who sells shoes. One particular brand uses European sizing 22-47 (we are in Australia). The shoes are also allocated to HikaShop categories Women/Men/Girl/Boy.  The product has a number of variants based on colour and size. My client would like to restrict the number of variants that are available for purchase based on how the online customer navigated to the product.  For example, if the online customer followed category “&#92;Footwear&#92;Men&#92;Casual”, they would only see sizes 38-47, if they followed “&#92;Footwear&#92;Women&#92;Casual”, they would only see 34-40 (notice that there is an overlap). Categories “&#92;Footwear&#92;Girls&#92;Casual” and “&#92;Footwear&#92;Boy&#92;Casual” would both show only sizes 22-36 (duplicate sizes and overlapping with women).  The only way I can think to do this as the moment is to create 4 “products” for the same physical product, create 4 “characteristics” based on size then then create 4 sets of variants based on the combination of product &amp; characteristic. I suppose I could use a single “characteristic” set provided that I ensured that I did not create variants for unwanted size/category combination.  Is there an easier was to filter a set of variants into groups of sub-variants based on the content of a particular characteristic and/or category membership?")*

Hi,

Yes, it's the easiest solution that I see.
A product have a categories and all his variants have the same.
It would be possible to implement a custom plugin in order to have a filter but it would require some modifications in the HikaShop core (not a big one).

Adding some PHP code in the "product &#124; show" view would be the faster and the easier way.
The PHP code could still connect to the database in order to make requests, load some configuration in a specific table, etc.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzYwNzE3LWEtcXVlc3Rpb24tYWJvdXQtZmlsdGVyaW5nLXZhcmlhbnRzP3RtcGw9bWFya2Rvd24=) 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.053 seconds

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