Dynamicweb.eCommerce.Orders Namespace > OrderLine Class : CanBeMerged Method |
true
if this instance can be merged with another order line; otherwise, false
.class MyPage : System.Web.UI.Page { private Order order; public void AddLine(OrderLine orderLine) { bool merged = false; foreach (OrderLine ol in order.OrderLines) { if (!(string.IsNullOrEmpty(ol.DiscountID))) { continue; } if (ol.CanBeMerged(orderLine)) { merged = true; if ((ol.Quantity + orderLine.Quantity) < 1) { List.Remove(ol); ol.Delete(); } else { ol.Quantity += orderLine.Quantity; } UpdateBOMOrderLine(ol); break; } } if (merged == false) { order.OrderLines.Add(orderLine); } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2