本文整理汇总了C#中SKUInfo.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# SKUInfo.GetValue方法的具体用法?C# SKUInfo.GetValue怎么用?C# SKUInfo.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SKUInfo
的用法示例。
在下文中一共展示了SKUInfo.GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSKUPriceInternal
/// <summary>
/// Returns catalogue price of the given product based on the SKU data and shopping cart data.
/// By default price is loaded from the SKUPrice field.
/// </summary>
/// <param name="sku">SKU dta</param>
/// <param name="cart">Shopping cart data</param>
protected override double GetSKUPriceInternal(SKUInfo sku, ShoppingCartInfo cart)
{
double price = 0;
// 1) Get base SKU price according to the shopping cart data (current culture)
if (cart != null)
{
switch (cart.ShoppingCartCulture.ToLower())
{
case "en-us":
// Get price form SKUEnUsPrice field
price = ValidationHelper.GetDouble(sku.GetValue("SKUEnUsPrice"), 0);
break;
case "cs-cz":
// Get price form SKUCsCzPrice field
price = ValidationHelper.GetDouble(sku.GetValue("SKUCsCzPrice"), 0);
break;
}
}
//// 2) Get base SKU price according to the product properties (product status)
//PublicStatusInfo status = PublicStatusInfoProvider.GetPublicStatusInfo(sku.SKUPublicStatusID);
//if ((status != null) && (status.PublicStatusName.ToLower() == "discounted"))
//{
// // Get price form SKUDiscountedPrice field
// price = ValidationHelper.GetDouble(sku.GetValue("SKUDiscountedPrice"), 0);
//}
if (price == 0)
{
// Get price from the SKUPrice field by default
return base.GetSKUPriceInternal(sku, cart);
}
else
{
// Return custom price
return price;
}
}