Display variant in product list

  • Posts: 178
  • Thank you received: 0
4 years 1 month ago #316491

-- HikaShop version -- : 4.2.3

hello i search a systeme to display variant in product list page
i create a jewel site
ex : 1 product 2 colors and i use filter by color
i have 2 ideas but not sure its possible :
- display all variant like a unique products
- display only main product (that ok) but maybe an idea is to display a light effect to change image
did you think its possible ? di you have an idea fo how to ?
regards

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
4 years 1 month ago #316495

The system is not made to be able to display the variants directly in the listings. So first option would require complex and time consuming coding to be able to do that.
Now changing the image of the main products on the listing when the filter selection changes, that's possible with some javascript coding in the listing view. That would be way more simple. An average developer with no particular knowledge of HikaShop should be able to do that.

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

  • Posts: 178
  • Thank you received: 0
4 years 1 month ago #316503

hello can you explain a little how to find and load variant image and i will try to adapt js
regards

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
4 years 1 month ago #316505

Hi,

Well, what I would recommend is to name your images in a specific way.
For example, if the two colors you have a blue and black, I would recommend to have your images end with _black or _blue with the rest being the same.
That way, on the listing, when you change the filtering, you can use a bit of javascript to change the src attribute of the img tags in the listing area to replace "_black" with "_blue" and vice-versa. That way, you don't have complex loading of data from the server etc.

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

  • Posts: 178
  • Thank you received: 0
4 years 1 month ago #316575

ok i will test
thanks

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

Time to create page: 0.066 seconds
Powered by Kunena Forum