Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

DotLiquidOrder - add additional tokens

KrzysztofPajakb73a71bc6a04
diff --git a/src/Business/Grand.Business.Messages/DotLiquidDrops/LiquidOrder.cs b/src/Business/Grand.Business.Messages/DotLiquidDrops/LiquidOrder.cs
index 2b724d933..0383fb30f 100644
--- a/src/Business/Grand.Business.Messages/DotLiquidDrops/LiquidOrder.cs
+++ b/src/Business/Grand.Business.Messages/DotLiquidDrops/LiquidOrder.cs
@@ -222,7 +222,17 @@ namespace Grand.Business.Messages.DotLiquidDrops
get { return string.Format("{0}/orderdetails/{1}", url, _order.Id); }
}
- public string AmountRefunded { get; set; }
+ public double PaidAmount {
+ get {
+ return _order.PaidAmount;
+ }
+ }
+
+ public double RefundedAmount {
+ get {
+ return _order.RefundedAmount;
+ }
+ }
public string NewNoteText
{
@@ -316,6 +326,31 @@ namespace Grand.Business.Messages.DotLiquidDrops
public string RPAmount { get; set; }
+
+ public bool IsRecurring {
+ get {
+ return _order.IsRecurring;
+ }
+ }
+
+ public int RecurringCycleLength {
+ get {
+ return _order.RecurringCycleLength;
+ }
+ }
+
+ public int RecurringCyclePeriodId {
+ get {
+ return (int)_order.RecurringCyclePeriodId;
+ }
+ }
+
+ public int RecurringTotalCycles {
+ get {
+ return _order.RecurringTotalCycles;
+ }
+ }
+
public IDictionary<string, string> AdditionalTokens { get; set; }
}
}
diff --git a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs
index 6b2f247ac..015490fc5 100644
--- a/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs
+++ b/src/Business/Grand.Business.System/Commands/Handlers/Messages/GetOrderTokensCommandHandler.cs
@@ -11,7 +11,6 @@ using Grand.Business.Common.Interfaces.Localization;
using Grand.Business.Customers.Interfaces;
using Grand.Business.Messages.Commands.Models;
using Grand.Business.Messages.DotLiquidDrops;
-using Grand.Domain.Catalog;
using Grand.Domain.Shipping;
using Grand.Domain.Tax;
using Grand.Domain.Vendors;
@@ -138,7 +137,6 @@ namespace Grand.Business.System.Commands.Handlers.Messages
var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(request.Order.PaymentMethodSystemName);
liquidOrder.PaymentMethod = paymentMethod != null ? paymentMethod.FriendlyName : request.Order.PaymentMethodSystemName;
- liquidOrder.AmountRefunded = _priceFormatter.FormatPrice(request.RefundedAmount, currency, language, false);
var dict = new Dictionary<string, string>();
foreach (var item in request.Order.OrderTaxes)
@@ -149,13 +147,13 @@ namespace Grand.Business.System.Commands.Handlers.Messages
if (string.IsNullOrEmpty(taxRate))
taxRate = item.Percent.ToString();
- if(!dict.ContainsKey(taxRate))
+ if (!dict.ContainsKey(taxRate))
dict.Add(taxRate, taxValue);
}
liquidOrder.TaxRates = dict;
- Dictionary<string, string> cards = new Dictionary<string, string>();
+ var cards = new Dictionary<string, string>();
var gcuhC = await _giftVoucherService.GetAllGiftVoucherUsageHistory(request.Order.Id);
foreach (var gcuh in gcuhC)
{