Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. @foreach (ILineItem item in Model.Items.Where(x => x.LineItemType == LineItemType.Product))
  2. {
  3. Merchello.Web.Models.ContentEditing.ProductDisplay productDisplay = merchelloHelper.Query.Product.GetBySku(item.Sku);
  4. Merchello.Web.Models.ContentEditing.ProductVariantDisplay productVariantDisplay = null;
  5. Merchello.Web.Models.VirtualContent.IProductContent myProduct = null;
  6.  
  7. if(productDisplay != null)
  8. {
  9. myProduct = merchelloHelper.TypedProductContent(productDisplay.Key);
  10. }
  11. else
  12. {
  13. productVariantDisplay = merchelloHelper.Query.Product.GetProductVariantBySku(item.Sku);
  14. myProduct = merchelloHelper.TypedProductContent(productVariantDisplay.Key);
  15. }
  16.  
  17. var product = myProduct;
  18.  
  19. IPublishedContent image = null;
  20.  
  21. if (product.HasValue("image"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement