本文整理汇总了C#中Orders.AsPurchasable方法的典型用法代码示例。如果您正苦于以下问题:C# Orders.AsPurchasable方法的具体用法?C# Orders.AsPurchasable怎么用?C# Orders.AsPurchasable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orders
的用法示例。
在下文中一共展示了Orders.AsPurchasable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveProductToWishList
public bool SaveProductToWishList(Orders.IPurchasable p, OptionSelectionList selections, int quantity, MerchantTribeApplication app)
{
WishListItem wi = new WishListItem();
if (p != null)
{
Orders.PurchasableSnapshot snapshot = p.AsPurchasable(selections, app, true);
if (snapshot != null)
{
wi.ProductId = snapshot.ProductId;
wi.Quantity = quantity;
wi.SelectionData = snapshot.SelectionData;
wi.CustomerId = app.CurrentCustomerId;
}
}
return WishListItems.Create(wi);
}
示例2: ConvertProductToLineItem
// Products and Line Items
public Orders.LineItem ConvertProductToLineItem(Orders.IPurchasable p, OptionSelectionList selections, int quantity, MerchantTribeApplication app)
{
Orders.LineItem li = new Orders.LineItem();
if (p != null)
{
Orders.PurchasableSnapshot snapshot = p.AsPurchasable(selections, app, true);
if (snapshot != null)
{
li.BasePricePerItem = snapshot.BasePrice;
li.ProductId = snapshot.ProductId;
li.ProductName = snapshot.Name;
li.ProductShippingHeight = snapshot.ShippingDetails.Height;
li.ProductShippingLength = snapshot.ShippingDetails.Length;
li.ProductShippingWeight = snapshot.ShippingDetails.Weight;
li.ProductShippingWidth = snapshot.ShippingDetails.Width;
li.ProductShortDescription = snapshot.Description;
li.ProductSku = snapshot.Sku;
li.Quantity = quantity;
li.SelectionData = snapshot.SelectionData;
li.ShippingSchedule = snapshot.ShippingDetails.ShippingScheduleId;
li.VariantId = snapshot.VariantId;
li.TaxSchedule = snapshot.TaxScheduleId;
li.ShipFromAddress = snapshot.ShippingDetails.ShippingSourceAddress;
li.ShipFromMode = snapshot.ShippingDetails.ShippingSource;
li.ShipFromNotificationId = snapshot.ShippingDetails.ShippingSourceId;
li.ShipSeparately = snapshot.ShippingDetails.ShipSeparately;
li.ExtraShipCharge = snapshot.ShippingDetails.ExtraShipFee;
}
}
return li;
}