Commits

Bertrand Le Roy committed 8ec2bc9

Orders with the same product added twice with different attributes doesn't crash the order details pages.

Comments (0)

Files changed (2)

Controllers/OrderSslController.cs

             var billingAddress = _addressFormatter.Format(order.BillingAddress);
             var shippingAddress = _addressFormatter.Format(order.ShippingAddress);
             var products = _contentManager
-                .GetMany<IContent>(order.Items.Select(p => p.ProductId), VersionOptions.Latest, QueryHints.Empty)
+                .GetMany<IContent>(
+                    order.Items.Select(p => p.ProductId).Distinct(),
+                    VersionOptions.Latest,
+                    QueryHints.Empty)
                 .ToDictionary(p => p.Id, p => p);
             var shape = _shapeFactory.Order_Confirmation(
                 OrderId: order.Id,

Drivers/OrderPartDriver.cs

 
             var contentManager = part.ContentItem.ContentManager;
             var products = contentManager
-                .GetMany<IContent>(part.Items.Select(p => p.ProductId), VersionOptions.Latest, QueryHints.Empty)
+                .GetMany<IContent>(
+                    part.Items.Select(p => p.ProductId).Distinct(),
+                    VersionOptions.Latest, QueryHints.Empty)
                 .ToDictionary(p => p.Id, p => p);
             var linkToTransaction = _checkoutServices
                 .Select(s => s.GetChargeAdminUrl(part.CreditCardCharge.TransactionId))