Developer forum

Forum » Ecommerce - Standard features » Variant option images

Variant option images

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to implement a Variant selector and I want to use images for color options.

I see that the default implementation in Swift is based on VariantGroupViewModel and VariantOptionViewModel.

VariantOptionViewModel has an Image property but it returns the image from the variant associated with the option and not the option itself.

Variant options have 3 Image properties in the interface: ImageSmall, ImageMedium, and ImageLarge. I don't plan on using all of them, but anyone of them would be far better than the Variant image.
How do I access the image property of the Option?

Thank you,
Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

VariantOptionViewModel has an Image property.

We are changing how variant selector works on Swift and is adding a rendering mode on variant groups. In this way you can use configuration of each variant group how they should render - as product image, option color, icon, option image or option name. This new rendering mode is being implemented in Swift templates.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I have noticed the Image property but that one seems to render the image of the variant and not the Option.

I am looking forward to seeing the new mode,.

Thank you,
Adrian

 
Suzi Louring
Reply

+1

 

You must be logged in to post in the forum