private async Task PrepareOrder(CustomerOrderListModel model, GetCustomerOrderList request) { var orders = await _orderService.SearchOrders(storeId : request.Store.Id, customerId : request.Customer.Id); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, OrderNumber = order.OrderNumber, OrderCode = order.Code, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, request.Language.Id), PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, request.Language.Id), ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, request.Language.Id), IsReturnRequestAllowed = await _mediator.Send(new IsReturnRequestAllowedQuery() { Order = order }) }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = await _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, request.Language); model.Orders.Add(orderModel); } }
/// <summary> /// Prepare the customer order list model /// </summary> /// <returns> /// A task that represents the asynchronous operation /// The task result contains the customer order list model /// </returns> public virtual async Task <CustomerOrderListModel> PrepareCustomerOrderListModelAsync() { var model = new CustomerOrderListModel(); var customer = await _workContext.GetCurrentCustomerAsync(); var store = await _storeContext.GetCurrentStoreAsync(); var orders = await _orderService.SearchOrdersAsync(storeId : store.Id, customerId : customer.Id); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = await _dateTimeHelper.ConvertToUserTimeAsync(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = await _localizationService.GetLocalizedEnumAsync(order.OrderStatus), PaymentStatus = await _localizationService.GetLocalizedEnumAsync(order.PaymentStatus), ShippingStatus = await _localizationService.GetLocalizedEnumAsync(order.ShippingStatus), IsReturnRequestAllowed = await _orderProcessingService.IsReturnRequestAllowedAsync(order), CustomOrderNumber = order.CustomOrderNumber }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = await _priceFormatter.FormatPriceAsync(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, (await _workContext.GetWorkingLanguageAsync()).Id); model.Orders.Add(orderModel); } var recurringPayments = await _orderService.SearchRecurringPaymentsAsync(store.Id, customer.Id); foreach (var recurringPayment in recurringPayments) { var order = await _orderService.GetOrderByIdAsync(recurringPayment.InitialOrderId); var recurringPaymentModel = new CustomerOrderListModel.RecurringOrderModel { Id = recurringPayment.Id, StartDate = (await _dateTimeHelper.ConvertToUserTimeAsync(recurringPayment.StartDateUtc, DateTimeKind.Utc)).ToString(), CycleInfo = $"{recurringPayment.CycleLength} {await _localizationService.GetLocalizedEnumAsync(recurringPayment.CyclePeriod)}", NextPayment = await _orderProcessingService.GetNextPaymentDateAsync(recurringPayment) is DateTime nextPaymentDate ? (await _dateTimeHelper.ConvertToUserTimeAsync(nextPaymentDate, DateTimeKind.Utc)).ToString() : "", TotalCycles = recurringPayment.TotalCycles, CyclesRemaining = await _orderProcessingService.GetCyclesRemainingAsync(recurringPayment), InitialOrderId = order.Id, InitialOrderNumber = order.CustomOrderNumber, CanCancel = await _orderProcessingService.CanCancelRecurringPaymentAsync(customer, recurringPayment), CanRetryLastPayment = await _orderProcessingService.CanRetryLastRecurringPaymentAsync(customer, recurringPayment) }; model.RecurringOrders.Add(recurringPaymentModel); } return(model); }
/// <summary> /// Prepare the customer order list model /// </summary> /// <returns>Customer order list model</returns> public virtual CustomerOrderListModel PrepareCustomerOrderListModel() { var model = new CustomerOrderListModel(); var orders = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, customerId: _workContext.CurrentCustomer.Id); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), IsReturnRequestAllowed = _orderProcessingService.IsReturnRequestAllowed(order), CustomOrderNumber = order.CustomOrderNumber, // ++ CanCancelOrderForCustomer CanCancelOrder = _orderProcessingService.CanCancelOrderForCustomer(order), }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, _workContext.WorkingLanguage); model.Orders.Add(orderModel); } var recurringPayments = _orderService.SearchRecurringPayments(_storeContext.CurrentStore.Id, _workContext.CurrentCustomer.Id); foreach (var recurringPayment in recurringPayments) { var recurringPaymentModel = new CustomerOrderListModel.RecurringOrderModel { Id = recurringPayment.Id, StartDate = _dateTimeHelper.ConvertToUserTime(recurringPayment.StartDateUtc, DateTimeKind.Utc).ToString(), CycleInfo = $"{recurringPayment.CycleLength} {recurringPayment.CyclePeriod.GetLocalizedEnum(_localizationService, _workContext)}", NextPayment = recurringPayment.NextPaymentDate.HasValue ? _dateTimeHelper.ConvertToUserTime(recurringPayment.NextPaymentDate.Value, DateTimeKind.Utc).ToString() : "", TotalCycles = recurringPayment.TotalCycles, CyclesRemaining = recurringPayment.CyclesRemaining, InitialOrderId = recurringPayment.InitialOrder.Id, InitialOrderNumber = recurringPayment.InitialOrder.CustomOrderNumber, CanCancel = _orderProcessingService.CanCancelRecurringPayment(_workContext.CurrentCustomer, recurringPayment), CanRetryLastPayment = _orderProcessingService.CanRetryLastRecurringPayment(_workContext.CurrentCustomer, recurringPayment) }; model.RecurringOrders.Add(recurringPaymentModel); } return(model); }
private async Task PrepareOrder(CustomerOrderListModel model, GetCustomerOrderList request) { var query = new GetOrderQuery { StoreId = request.Store.Id }; if (!request.Customer.IsOwner()) { query.CustomerId = request.Customer.Id; } else { query.OwnerId = request.Customer.Id; } var orders = await _mediator.Send(query); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, OrderNumber = order.OrderNumber, OrderCode = order.Code, CustomerEmail = order.BillingAddress?.Email, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, request.Language.Id), PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, request.Language.Id), ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, request.Language.Id), IsReturnRequestAllowed = await _mediator.Send(new IsReturnRequestAllowedQuery() { Order = order }) }; orderModel.OrderTotal = await _priceFormatter.FormatPrice(order.OrderTotal, true, order.CustomerCurrencyCode, false, request.Language); model.Orders.Add(orderModel); } }
/// <summary> /// Prepare the customer order list model /// </summary> /// <returns>Customer order list model</returns> public virtual CustomerOrderListModel PrepareCustomerOrderListModel() { var model = new CustomerOrderListModel(); var orders = _orderService.SearchOrders(customerId: _workContext.CurrentCustomer.Id); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), CustomOrderNumber = order.CustomOrderNumber }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, _workContext.WorkingLanguage); model.Orders.Add(orderModel); } return(model); }
/// <summary> /// Prepare the customer order list model /// </summary> /// <returns>Customer order list model</returns> public virtual CustomerOrderListModel PrepareCustomerOrderListModel(int?page) { var model = new CustomerOrderListModel(); var pageSize = 5; var orders = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, customerId: _workContext.CurrentCustomer.Id, pageIndex: --page ?? 0, pageSize: pageSize); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = _localizationService.GetLocalizedEnum(order.OrderStatus), PaymentStatus = _localizationService.GetLocalizedEnum(order.PaymentStatus), ShippingStatus = _localizationService.GetLocalizedEnum(order.ShippingStatus), IsReturnRequestAllowed = _orderProcessingService.IsReturnRequestAllowed(order), CustomOrderNumber = order.CustomOrderNumber }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, _workContext.WorkingLanguage); model.Orders.Add(orderModel); } model.PagerModel = new PagerModel { PageSize = orders.PageSize, TotalRecords = orders.TotalCount, PageIndex = orders.PageIndex, ShowTotalSummary = false, RouteActionName = "CustomerOrdersListPaged", UseRouteLinks = true, RouteValues = new OrdersListRouteValues { pageNumber = page ?? 0 } }; var recurringPayments = _orderService.SearchRecurringPayments(_storeContext.CurrentStore.Id, _workContext.CurrentCustomer.Id); foreach (var recurringPayment in recurringPayments) { var recurringPaymentModel = new CustomerOrderListModel.RecurringOrderModel { Id = recurringPayment.Id, StartDate = _dateTimeHelper.ConvertToUserTime(recurringPayment.StartDateUtc, DateTimeKind.Utc).ToString(), CycleInfo = $"{recurringPayment.CycleLength} {_localizationService.GetLocalizedEnum(recurringPayment.CyclePeriod)}", NextPayment = recurringPayment.NextPaymentDate.HasValue ? _dateTimeHelper.ConvertToUserTime(recurringPayment.NextPaymentDate.Value, DateTimeKind.Utc).ToString() : "", TotalCycles = recurringPayment.TotalCycles, CyclesRemaining = recurringPayment.CyclesRemaining, InitialOrderId = recurringPayment.InitialOrder.Id, InitialOrderNumber = recurringPayment.InitialOrder.CustomOrderNumber, CanCancel = _orderProcessingService.CanCancelRecurringPayment(_workContext.CurrentCustomer, recurringPayment), CanRetryLastPayment = _orderProcessingService.CanRetryLastRecurringPayment(_workContext.CurrentCustomer, recurringPayment) }; model.RecurringOrders.Add(recurringPaymentModel); } return(model); }
/// <summary> /// Prepare the customer order list model /// </summary> /// <returns>Customer order list model</returns> public virtual CustomerOrderListModel PrepareCustomerOrderListModel(string status, int?page, int?pageSize) { if (page == 0) { page = null; } List <int> statusList = new List <int>(); if (!string.IsNullOrEmpty(status)) { if (status == ((int)OrderStatus.Cancelled).ToString()) { statusList.Add((int)OrderStatus.Cancelled); } if (status == ((int)OrderStatus.Pending).ToString()) { statusList.Add((int)OrderStatus.Pending); statusList.Add((int)OrderStatus.Processing); } } var model = new CustomerOrderListModel(); var orders = _orderService.SearchOrders(storeId: _storeContext.CurrentStore.Id, customerId: _workContext.CurrentCustomer.Id, osIds: statusList); //pageIndex: --page ?? 0, pageSize: 5, List <CustomerOrderListModel.OrderDetailsModel> allOrders = new List <CustomerOrderListModel.OrderDetailsModel>(); foreach (var order in orders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = _dateTimeHelper.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = order.OrderStatus.GetLocalizedEnum(_localizationService, _workContext), PaymentStatus = order.PaymentStatus.GetLocalizedEnum(_localizationService, _workContext), ShippingStatus = order.ShippingStatus.GetLocalizedEnum(_localizationService, _workContext), IsReturnRequestAllowed = _orderProcessingService.IsReturnRequestAllowed(order), CustomOrderNumber = order.CustomOrderNumber }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = _priceFormatter.FormatPrice(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, _workContext.WorkingLanguage); allOrders.Add(orderModel); } List <CustomerOrderListModel.OrderDetailsModel> legacyOrders = null; var miscPlugins = _pluginFinder.GetPlugins <MyOrderServicePlugin>(storeId: EngineContext.Current.Resolve <IStoreContext>().CurrentStore.Id).ToList(); if (miscPlugins.Count > 0 && _gbsOrderSettings.LegacyOrdersInOrderHistory) { legacyOrders = new Orders.OrderExtensions().getLegacyOrders(); if (!string.IsNullOrEmpty(status)) { legacyOrders = legacyOrders.Where(x => statusList.Contains((int)x.OrderStatusEnum)).ToList(); } if (legacyOrders != null && legacyOrders.Count() > 0) { allOrders.AddRange(legacyOrders); } allOrders.Sort((x, y) => y.CreatedOn.CompareTo(x.CreatedOn)); } var ordersPaging = new PagedList <CustomerOrderListModel.OrderDetailsModel>(allOrders, pageIndex: --page ?? 0, pageSize: pageSize ?? 5); model.Orders = ordersPaging.ToList(); // do paging on orders var recurringPayments = _orderService.SearchRecurringPayments(_storeContext.CurrentStore.Id, _workContext.CurrentCustomer.Id); foreach (var recurringPayment in recurringPayments) { var recurringPaymentModel = new CustomerOrderListModel.RecurringOrderModel { Id = recurringPayment.Id, StartDate = _dateTimeHelper.ConvertToUserTime(recurringPayment.StartDateUtc, DateTimeKind.Utc).ToString(), CycleInfo = string.Format("{0} {1}", recurringPayment.CycleLength, recurringPayment.CyclePeriod.GetLocalizedEnum(_localizationService, _workContext)), NextPayment = recurringPayment.NextPaymentDate.HasValue ? _dateTimeHelper.ConvertToUserTime(recurringPayment.NextPaymentDate.Value, DateTimeKind.Utc).ToString() : "", TotalCycles = recurringPayment.TotalCycles, CyclesRemaining = recurringPayment.CyclesRemaining, InitialOrderId = recurringPayment.InitialOrder.Id, InitialOrderNumber = recurringPayment.InitialOrder.CustomOrderNumber, CanCancel = _orderProcessingService.CanCancelRecurringPayment(_workContext.CurrentCustomer, recurringPayment), CanRetryLastPayment = _orderProcessingService.CanRetryLastRecurringPayment(_workContext.CurrentCustomer, recurringPayment) }; model.RecurringOrders.Add(recurringPaymentModel); } model.CustomProperties["PagerModel"] = new PagerModel { PageSize = ordersPaging.PageSize, TotalRecords = ordersPaging.TotalCount, PageIndex = ordersPaging.PageIndex, ShowTotalSummary = true, RouteActionName = "CustomerOrders", UseRouteLinks = true, RouteValues = new OrderRouteValues { page = page ?? 0, status = status, pageSize = pageSize } }; if (model.Orders.Any()) { model.Orders.FirstOrDefault().CustomProperties["PagerModel"] = new PagerModel { PageSize = ordersPaging.PageSize, TotalRecords = ordersPaging.TotalCount, PageIndex = ordersPaging.PageIndex, ShowTotalSummary = true, RouteActionName = "CustomerOrders", UseRouteLinks = true, RouteValues = new OrderRouteValues { page = page ?? 0, status = status, pageSize = pageSize } }; } return(model); }
private async Task PrepareOrder(CustomerOrderListModel model, GetCustomerOrderList request) { if (request.Command.PageSize <= 0) { request.Command.PageSize = _orderSettings.PageSize; } if (request.Command.PageNumber <= 0) { request.Command.PageNumber = 1; } if (request.Command.PageSize == 0) { request.Command.PageSize = 10; } var customerId = string.Empty; var ownerId = string.Empty; if (!await _groupService.IsOwner(request.Customer)) { customerId = request.Customer.Id; } else { ownerId = request.Customer.Id; } var orders = await _orderService.SearchOrders( customerId : customerId, ownerId : ownerId, storeId : request.Store.Id, pageIndex : request.Command.PageNumber - 1, pageSize : request.Command.PageSize); model.PagingContext.LoadPagedList(orders); foreach (var order in orders) { var status = await _orderStatusService.GetByStatusId(order.OrderStatusId); var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, OrderNumber = order.OrderNumber, OrderCode = order.Code, CustomerEmail = order.BillingAddress?.Email, CreatedOn = _dateTimeService.ConvertToUserTime(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusId = order.OrderStatusId, OrderStatus = status?.Name, PaymentStatus = order.PaymentStatusId.GetTranslationEnum(_translationService, request.Language.Id), ShippingStatus = order.ShippingStatusId.GetTranslationEnum(_translationService, request.Language.Id), IsMerchandiseReturnAllowed = await _mediator.Send(new IsMerchandiseReturnAllowedQuery() { Order = order }) }; orderModel.OrderTotal = await _priceFormatter.FormatPrice(order.OrderTotal, order.CustomerCurrencyCode, false, request.Language); model.Orders.Add(orderModel); } }
public async Task <IActionResult> GetUpcomingOrders() { var customer = await _workContext.GetCurrentCustomerAsync(); var orders = await _orderService.SearchOrdersAsync(customerId : customer.Id); var perviousOrders = orders.Where(x => x.ScheduleDate.Date > DateTime.Now.Date); if (perviousOrders.Any()) { var languageId = _workContext.GetWorkingLanguageAsync().Id; var model = new CustomerOrderListModel(); foreach (var order in perviousOrders) { var orderModel = new CustomerOrderListModel.OrderDetailsModel { Id = order.Id, CreatedOn = await _dateTimeHelper.ConvertToUserTimeAsync(order.CreatedOnUtc, DateTimeKind.Utc), OrderStatusEnum = order.OrderStatus, OrderStatus = await _localizationService.GetLocalizedEnumAsync(order.OrderStatus), PaymentStatus = await _localizationService.GetLocalizedEnumAsync(order.PaymentStatus), ShippingStatus = await _localizationService.GetLocalizedEnumAsync(order.ShippingStatus), IsReturnRequestAllowed = await _orderProcessingService.IsReturnRequestAllowedAsync(order), CustomOrderNumber = order.CustomOrderNumber, ScheduleDate = await _dateTimeHelper.ConvertToUserTimeAsync(order.ScheduleDate, DateTimeKind.Utc), Rating = order.Rating, RatingText = order.RatingText }; var orderTotalInCustomerCurrency = _currencyService.ConvertCurrency(order.OrderTotal, order.CurrencyRate); orderModel.OrderTotal = await _priceFormatter.FormatPriceAsync(orderTotalInCustomerCurrency, true, order.CustomerCurrencyCode, false, _workContext.GetWorkingLanguageAsync().Id); var orderItems = await _orderService.GetOrderItemsAsync(order.Id); foreach (var orderItem in orderItems) { var product = await _productService.GetProductByIdAsync(orderItem.ProductId); var productPicture = await _pictureService.GetPicturesByProductIdAsync(orderItem.ProductId); var vendor = await _vendorService.GetVendorByProductIdAsync(product.Id); var orderItemModel = new OrderDetailsModel.OrderItemModel { Id = orderItem.Id, OrderItemGuid = orderItem.OrderItemGuid, Sku = await _productService.FormatSkuAsync(product, orderItem.AttributesXml), VendorName = vendor != null ? vendor.Name : string.Empty, ProductId = product.Id, ProductName = await _localizationService.GetLocalizedAsync(product, x => x.Name), ProductPictureUrl = productPicture.Any() ? await _pictureService.GetPictureUrlAsync(productPicture.FirstOrDefault().Id) : await _pictureService.GetDefaultPictureUrlAsync(), ProductSeName = await _urlRecordService.GetSeNameAsync(product), Quantity = orderItem.Quantity, AttributeInfo = orderItem.AttributeDescription, VendorLogoPictureUrl = await _pictureService.GetPictureUrlAsync(vendor != null?vendor.PictureId : 0, showDefaultPicture : true) }; //rental info if (product.IsRental) { var rentalStartDate = orderItem.RentalStartDateUtc.HasValue ? _productService.FormatRentalDate(product, orderItem.RentalStartDateUtc.Value) : ""; var rentalEndDate = orderItem.RentalEndDateUtc.HasValue ? _productService.FormatRentalDate(product, orderItem.RentalEndDateUtc.Value) : ""; orderItemModel.RentalInfo = string.Format(await _localizationService.GetResourceAsync("Order.Rental.FormattedDate"), rentalStartDate, rentalEndDate); } orderModel.Items.Add(orderItemModel); //unit price, subtotal if (order.CustomerTaxDisplayType == TaxDisplayType.IncludingTax) { //including tax var unitPriceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceInclTax, order.CurrencyRate); orderItemModel.UnitPrice = await _priceFormatter.FormatPriceAsync(unitPriceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, languageId, true); var priceInclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceInclTax, order.CurrencyRate); orderItemModel.SubTotal = await _priceFormatter.FormatPriceAsync(priceInclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, languageId, true); } else { //excluding tax var unitPriceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.UnitPriceExclTax, order.CurrencyRate); orderItemModel.UnitPrice = await _priceFormatter.FormatPriceAsync(unitPriceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, languageId, false); var priceExclTaxInCustomerCurrency = _currencyService.ConvertCurrency(orderItem.PriceExclTax, order.CurrencyRate); orderItemModel.SubTotal = await _priceFormatter.FormatPriceAsync(priceExclTaxInCustomerCurrency, true, order.CustomerCurrencyCode, languageId, false); } //downloadable products if (await _orderService.IsDownloadAllowedAsync(orderItem)) { orderItemModel.DownloadId = product.DownloadId; } if (await _orderService.IsLicenseDownloadAllowedAsync(orderItem)) { orderItemModel.LicenseId = orderItem.LicenseDownloadId ?? 0; } } model.Orders.Add(orderModel); } return(Ok(new { success = true, model })); } return(Ok(new { success = false, message = "No upcoming order found" })); }