Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Yetiish 6 posts 91 karma points
    Jan 06, 2014 @ 17:11
    Yetiish
    0

    Displaying Variant Image

    Hi,

    Viewing a product image is fairly straightforward:

    var url = CatalogLibrary.GetNiceUrlForProduct(product);
    @if (!string.IsNullOrEmpty(product.ThumbnailImageMediaId))
                {
                    dynamic mediaItem = new DynamicMedia(product.ThumbnailImageMediaId);
                    <a href="@url"><img src="@mediaItem.umbracoFile" /></a>
                }

    However, I am struggling to make a variant image visible (if it exists)

    I have added an image from the media library to each variant:

    But cannot work out how to display it as it does not have a ThumbnailImageMediaId.

    Any assistance would be greatly appreciated.

    Thanks in advance

  • Morten Skjoldager 440 posts 1499 karma points
    Jan 08, 2014 @ 10:37
    Morten Skjoldager
    0

    Hello Chris.

    I believe the Image you've added is a custom property from a definitionField you've called Image. You should use product["Image"].Value.

    Best regards

    Morten

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies