当前位置: 首页>>代码示例>>C#>>正文


C# Orders.AsPurchasable方法代码示例

本文整理汇总了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);
 }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:16,代码来源:CatalogService.cs

示例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;
        }
开发者ID:appliedi,项目名称:MerchantTribe,代码行数:34,代码来源:CatalogService.cs


注:本文中的Orders.AsPurchasable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。