本文整理汇总了C#中SmartStore.Core.Domain.Orders.Order.HasItemsToAddToShipment方法的典型用法代码示例。如果您正苦于以下问题:C# Order.HasItemsToAddToShipment方法的具体用法?C# Order.HasItemsToAddToShipment怎么用?C# Order.HasItemsToAddToShipment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartStore.Core.Domain.Orders.Order
的用法示例。
在下文中一共展示了Order.HasItemsToAddToShipment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareOrderDetailsModel
//.........这里部分代码省略.........
model.ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext); ;
if (order.ShippingStatus != ShippingStatus.ShippingNotRequired)
{
model.IsShippable = true;
model.ShippingAddress = order.ShippingAddress.ToModel();
model.ShippingAddress.FirstNameEnabled = true;
model.ShippingAddress.FirstNameRequired = true;
model.ShippingAddress.LastNameEnabled = true;
model.ShippingAddress.LastNameRequired = true;
model.ShippingAddress.EmailEnabled = true;
model.ShippingAddress.EmailRequired = true;
model.ShippingAddress.CompanyEnabled = _addressSettings.CompanyEnabled;
model.ShippingAddress.CompanyRequired = _addressSettings.CompanyRequired;
model.ShippingAddress.CountryEnabled = _addressSettings.CountryEnabled;
model.ShippingAddress.StateProvinceEnabled = _addressSettings.StateProvinceEnabled;
model.ShippingAddress.CityEnabled = _addressSettings.CityEnabled;
model.ShippingAddress.CityRequired = _addressSettings.CityRequired;
model.ShippingAddress.StreetAddressEnabled = _addressSettings.StreetAddressEnabled;
model.ShippingAddress.StreetAddressRequired = _addressSettings.StreetAddressRequired;
model.ShippingAddress.StreetAddress2Enabled = _addressSettings.StreetAddress2Enabled;
model.ShippingAddress.StreetAddress2Required = _addressSettings.StreetAddress2Required;
model.ShippingAddress.ZipPostalCodeEnabled = _addressSettings.ZipPostalCodeEnabled;
model.ShippingAddress.ZipPostalCodeRequired = _addressSettings.ZipPostalCodeRequired;
model.ShippingAddress.PhoneEnabled = _addressSettings.PhoneEnabled;
model.ShippingAddress.PhoneRequired = _addressSettings.PhoneRequired;
model.ShippingAddress.FaxEnabled = _addressSettings.FaxEnabled;
model.ShippingAddress.FaxRequired = _addressSettings.FaxRequired;
model.ShippingMethod = order.ShippingMethod;
model.ShippingAddressGoogleMapsUrl = string.Format("http://maps.google.com/maps?f=q&hl=en&ie=UTF8&oe=UTF8&geocode=&q={0}", Server.UrlEncode(order.ShippingAddress.Address1 + " " + order.ShippingAddress.ZipPostalCode + " " + order.ShippingAddress.City + " " + (order.ShippingAddress.Country != null ? order.ShippingAddress.Country.Name : "")));
model.CanAddNewShipments = order.HasItemsToAddToShipment();
}
#endregion
#region Products
model.CheckoutAttributeInfo = HtmlUtils.ConvertPlainTextToTable(HtmlUtils.ConvertHtmlToPlainText(order.CheckoutAttributeDescription));
//model.CheckoutAttributeInfo = order.CheckoutAttributeDescription;
//model.CheckoutAttributeInfo = _checkoutAttributeFormatter.FormatAttributes(_workContext.CurrentCustomer.CheckoutAttributes, _workContext.CurrentCustomer, "", false);
bool hasDownloadableItems = false;
foreach (var orderItem in order.OrderItems)
{
if (orderItem.Product.IsDownload)
hasDownloadableItems = true;
orderItem.Product.MergeWithCombination(orderItem.AttributesXml);
var orderItemModel = new OrderModel.OrderItemModel()
{
Id = orderItem.Id,
ProductId = orderItem.ProductId,
ProductName = orderItem.Product.GetLocalized(x => x.Name),
Sku = orderItem.Product.Sku,
ProductType = orderItem.Product.ProductType,
ProductTypeName = orderItem.Product.GetProductTypeLabel(_localizationService),
ProductTypeLabelHint = orderItem.Product.ProductTypeLabelHint,
Quantity = orderItem.Quantity,
IsDownload = orderItem.Product.IsDownload,
DownloadCount = orderItem.DownloadCount,
DownloadActivationType = orderItem.Product.DownloadActivationType,
IsDownloadActivated = orderItem.IsDownloadActivated,
LicenseDownloadId = orderItem.LicenseDownloadId
};