Variants' images

  • Posts: 49
  • Thank you received: 1
5 years 1 month ago #304761

-- HikaShop version -- : 4.0.3
-- Joomla version -- : 9.4
-- PHP version -- : 7.2
-- Error-message(debug-mod must be tuned on) -- : no error

Hello,

How do I get the variant images within the product page?

I am trying to pull the variants' images out from the database and display it as an image, so instead of a radio button, I will make it an image.

I am dumping the data but the variant images are not showing among the data in the product's page.

Could you please help?

Thanks

Last edit: 5 years 1 month ago by onereik.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 1 month ago #304773

Hi,

The data of the images of the variants is definitely already loaded on the product page as the system already displays the images of the variants on it:
- if you're in "dropdown" or "radio" or "table" mode for the "characteristic selection method" setting of the HikaShop configuration, the images area of the product will be updated with the images of the current variant when you change the variant selected.
- if you're in "list" mode, the listing of the variants will display the images of the variants too.
You'll find the variants in $this->element->variants. Then, in each variant of that array, you'll have an "images" attributes which will be an array of the data of the images of the variant.

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

  • Posts: 49
  • Thank you received: 1
5 years 1 month ago #304804

Hi,

Thank you for the prompt reply, I can not see a list mode at all. In the characteristics, there is only a radio button and a dropdown mode.

There isn't any list mode.

Could you please let me know where I can display the list mode?

What I want to do is to have the first image of every variant as an option for example

"Color"
Let's assume I have a t-shirt that comes in black, gray and white.

So the black option should be the first image I uploaded in the variant for the black color instead of a radio button or a dropdown list, and same for other colors.

Thanks
Rei

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 1 month ago #304824

Hi,

As I said in my previous message, you want to look at the "characteristic selection method" setting of the HikaShop configuration.
The setting in the characteristics themselves indeed don't have the "list" choice and that's normal.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum