Closed bleroy closed 8 years ago
Originally reported by: Anonymous
Thanks for that awesome module Betrand.
I am facing an issue with ProductImage not being displayed in Shopping cart view:
#!c# private IEnumerable<dynamic> GetProductShapesFromQuantities( IEnumerable<ShoppingCartQuantityProduct> productQuantities) { var productShapes = productQuantities.Select( productQuantity => _shapeFactory.ShoppingCartItem( Quantity: productQuantity.Quantity, Product: productQuantity.Product, Sku: productQuantity.Product.Sku, Title: _contentManager.GetItemMetadata(productQuantity.Product).DisplayText, ProductAttributes: productQuantity.AttributeIdsToValues, ContentItem: (productQuantity.Product).ContentItem, ProductImage: ((dynamic)productQuantity.Product.ContentItem).Product.ProductImage.MediaParts[0], //((MediaLibraryPickerField) productQuantity.Product.Fields.FirstOrDefault(f => f.Name == "ProductImage")), IsDigital: productQuantity.Product.IsDigital, Price: productQuantity.Product.Price, DiscountedPrice: productQuantity.Price, LinePriceAdjustment: productQuantity.LinePriceAdjustment, Promotion: productQuantity.Promotion, ShippingCost: productQuantity.Product.ShippingCost, Weight: productQuantity.Product.Weight, MinimumOrderQuantity: productQuantity.Product.MinimumOrderQuantity)).ToList(); return productShapes; }
productQuantity.Product.Fields is empty. Changed code here to
#!c# ProductImage: ((dynamic)productQuantity.Product.ContentItem).Product.ProductImage.MediaParts[0],
and it worked for me.
Additionaly needed to Change in ShoppingCart.cshtml:
#!c# item.ProductImage.Url
to
#!c# item.ProductImage.MediaUrl
Is this a general issue or just happening here?
Thanks Dieter
Original comment by Dieter Schüle (Bitbucket: dpomt, GitHub: dpomt):
Done: https://bitbucket.org/bleroy/nwazet.commerce/pull-request/28/shoppingcart-fix-for-product-image-not/diff
Original comment by Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy):
Can you make a pull request?
Originally reported by: Anonymous
Thanks for that awesome module Betrand.
I am facing an issue with ProductImage not being displayed in Shopping cart view:
productQuantity.Product.Fields is empty. Changed code here to
and it worked for me.
Additionaly needed to Change in ShoppingCart.cshtml:
to
Is this a general issue or just happening here?
Thanks Dieter