A Question about Filtering Variants

  • Posts: 35
  • Thank you received: 0
12 years 3 months ago #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 “\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 & 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 or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 3 months ago #60788

Hi,

You can unset unwanted variants in the "product | 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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 35
  • Thank you received: 0
12 years 3 months ago #60806

Thanks Jerome,

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

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 3 months ago #60807

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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 35
  • Thank you received: 0
12 years 3 months ago #60808

Thanks Jerome,

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

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
12 years 3 months ago #60809

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 | 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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum