Copied to clipboard

Flag this post as spam?

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


  • Jason 92 posts 175 karma points
    Feb 16, 2016 @ 22:37
    Jason
    0

    Accessing product details from Virtual Product Content

    Merch 1.14

    Do products associated with a Virtual Product Content (Document Type), still require a Merchello Product Selector in order to access product information (price, sku etc).

        public class ProductStandardModel : RenderModel
        {
            public ProductStandardModel()
            : base(UmbracoContext.Current.PublishedContentRequest.PublishedContent)
            {
    
            }
    
            public string Description { get { return Content.GetProperty("Description").Value.ToString(); } }
    
            // other properties for the standard merchello fields under here
        }
    
  • Jason 92 posts 175 karma points
    Feb 18, 2016 @ 21:34
    Jason
    0

    Figured it out - typically as easy as this..

    public class VirtualProductBase : RenderModel
    {
        public VirtualProductBase(IPublishedContent Content) : base(Content)
        {
        }
    
        public IProductContent Product
        {
            get { return Content as IProductContent; }
        }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft