本文整理汇总了C#中SmartStore.Core.Domain.Catalog.Product.DisplayDeliveryTimeAccordingToStock方法的典型用法代码示例。如果您正苦于以下问题:C# Product.DisplayDeliveryTimeAccordingToStock方法的具体用法?C# Product.DisplayDeliveryTimeAccordingToStock怎么用?C# Product.DisplayDeliveryTimeAccordingToStock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartStore.Core.Domain.Catalog.Product
的用法示例。
在下文中一共展示了Product.DisplayDeliveryTimeAccordingToStock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareProductDetailModel
//.........这里部分代码省略.........
if (selectedAttributeValues != null)
{
foreach (var attributeValue in selectedAttributeValues)
model.WeightValue = decimal.Add(model.WeightValue, attributeValue.WeightAdjustment);
}
else
{
model.WeightValue = decimal.Add(model.WeightValue, preSelectedWeightAdjustment);
}
}
model.Weight = (model.WeightValue > 0) ? "{0} {1}".FormatCurrent(model.WeightValue.ToString("F2"), _measureService.GetMeasureWeightById(_measureSettings.BaseWeightId).Name) : "";
model.Height = (product.Height > 0) ? "{0} {1}".FormatCurrent(product.Height.ToString("F2"), dimension) : "";
model.Length = (product.Length > 0) ? "{0} {1}".FormatCurrent(product.Length.ToString("F2"), dimension) : "";
model.Width = (product.Width > 0) ? "{0} {1}".FormatCurrent(product.Width.ToString("F2"), dimension) : "";
if (productBundleItem != null)
model.ThumbDimensions = _mediaSettings.BundledProductPictureSize;
else if (isAssociatedProduct)
model.ThumbDimensions = _mediaSettings.AssociatedProductPictureSize;
if (model.IsAvailable)
{
var deliveryTime = _deliveryTimeService.GetDeliveryTime(product);
if (deliveryTime != null)
{
model.DeliveryTimeName = deliveryTime.GetLocalized(x => x.Name);
model.DeliveryTimeHexValue = deliveryTime.ColorHexValue;
}
}
model.DisplayDeliveryTime = _catalogSettings.ShowDeliveryTimesInProductDetail;
model.IsShipEnabled = product.IsShipEnabled;
model.DisplayDeliveryTimeAccordingToStock = product.DisplayDeliveryTimeAccordingToStock(_catalogSettings);
if (model.DeliveryTimeName.IsEmpty() && model.DisplayDeliveryTime)
{
model.DeliveryTimeName = T("ShoppingCart.NotAvailable");
}
var quantityUnit = _quantityUnitService.GetQuantityUnit(product);
if (quantityUnit != null)
{
model.QuantityUnitName = quantityUnit.GetLocalized(x => x.Name);
}
//back in stock subscriptions)
if (product.ManageInventoryMethod == ManageInventoryMethod.ManageStock &&
product.BackorderMode == BackorderMode.NoBackorders &&
product.AllowBackInStockSubscriptions &&
product.StockQuantity <= 0)
{
//out of stock
model.DisplayBackInStockSubscription = true;
model.BackInStockAlreadySubscribed = _backInStockSubscriptionService.FindSubscription(customer.Id, product.Id, store.Id) != null;
}
#endregion
#region Product price
model.ProductPrice.ProductId = product.Id;
if (displayPrices)
{
model.ProductPrice.HidePrices = false;