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.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Cash on delivery plugin - allow editing settings - skip payment info
KrzysztofPajak6ddf9cd5bd71
diff --git a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.csindex 258526d22..93b54cba8 100644--- a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs+++ b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Controllers/PaymentCashOnDeliveryController.cs@@ -61,7 +61,8 @@ namespace Payments.CashOnDelivery.ControllersAdditionalFee = cashOnDeliveryPaymentSettings.AdditionalFee,AdditionalFeePercentage = cashOnDeliveryPaymentSettings.AdditionalFeePercentage,ShippableProductRequired = cashOnDeliveryPaymentSettings.ShippableProductRequired,- DisplayOrder = cashOnDeliveryPaymentSettings.DisplayOrder+ DisplayOrder = cashOnDeliveryPaymentSettings.DisplayOrder,+ SkipPaymentInfo = cashOnDeliveryPaymentSettings.SkipPaymentInfo,};model.DescriptionText = cashOnDeliveryPaymentSettings.DescriptionText;@@ -86,6 +87,7 @@ namespace Payments.CashOnDelivery.ControllerscashOnDeliveryPaymentSettings.AdditionalFeePercentage = model.AdditionalFeePercentage;cashOnDeliveryPaymentSettings.ShippableProductRequired = model.ShippableProductRequired;cashOnDeliveryPaymentSettings.DisplayOrder = model.DisplayOrder;+ cashOnDeliveryPaymentSettings.SkipPaymentInfo = model.SkipPaymentInfo;await _settingService.SaveSetting(cashOnDeliveryPaymentSettings, storeScope);diff --git a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Views/PaymentCashOnDelivery/Configure.cshtml b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Views/PaymentCashOnDelivery/Configure.cshtmlindex f6d36d1f0..19355194e 100644--- a/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Views/PaymentCashOnDelivery/Configure.cshtml+++ b/src/Plugins/Payments.CashOnDelivery/Areas/Admin/Views/PaymentCashOnDelivery/Configure.cshtml@@ -38,44 +38,62 @@</div></div></localized-editor>- <div class="form-body">- <div class="form-group">- <div class="col-md-3 col-sm-3 text-right">- <admin-label asp-for="AdditionalFee" class="control-label" />- </div>- <div class="col-md-9 col-sm-9">- <admin-input asp-for="AdditionalFee" />- <span asp-validation-for="AdditionalFee"></span>- </div>+ <div class="form-body">+ <div class="form-group">+ <div class="col-md-3 col-sm-3 text-right">+ <admin-label asp-for="AdditionalFee" class="control-label" /></div>- <div class="form-group">- <div class="col-md-3 col-sm-3 text-right">- <admin-label asp-for="AdditionalFeePercentage" class="control-label" />- </div>- <div class="col-md-9 col-sm-9">+ <div class="col-md-9 col-sm-9">+ <admin-input asp-for="AdditionalFee" />+ <span asp-validation-for="AdditionalFee"></span>+ </div>+ </div>+ <div class="form-group">+ <div class="col-md-3 col-sm-3 text-right">+ <admin-label asp-for="AdditionalFeePercentage" class="control-label" />+ </div>+ <div class="col-md-9 col-sm-9">+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox"><admin-input asp-for="AdditionalFeePercentage" />- <span asp-validation-for="AdditionalFeePercentage"></span>- </div>+ <div class="control__indicator"></div>+ </label>+ <span asp-validation-for="AdditionalFeePercentage"></span></div>- <div class="form-group">- <div class="col-md-3 col-sm-3 text-right">- <admin-label asp-for="ShippableProductRequired" class="control-label" />- </div>- <div class="col-md-9 col-sm-9">+ </div>+ <div class="form-group">+ <div class="col-md-3 col-sm-3 text-right">+ <admin-label asp-for="ShippableProductRequired" class="control-label" />+ </div>+ <div class="col-md-9 col-sm-9">+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox"><admin-input asp-for="ShippableProductRequired" />- <span asp-validation-for="ShippableProductRequired"></span>- </div>+ <div class="control__indicator"></div>+ </label>+ <span asp-validation-for="ShippableProductRequired"></span></div>- <div class="form-group">- <div class="col-md-3 col-sm-3 text-right">- <admin-label asp-for="DisplayOrder" class="control-label" />- </div>- <div class="col-md-9 col-sm-9">- <admin-input asp-for="DisplayOrder" />- <span asp-validation-for="DisplayOrder"></span>- </div>+ </div>+ <div class="form-group">+ <div class="col-md-3 col-sm-3 text-right">+ <admin-label asp-for="SkipPaymentInfo" class="control-label" />+ </div>+ <div class="col-md-9 col-sm-9">+ <label class="mt-checkbox mt-checkbox-outline control control-checkbox">+ <admin-input asp-for="SkipPaymentInfo" />+ <div class="control__indicator"></div>+ </label>+ <span asp-validation-for="SkipPaymentInfo"></span></div></div>+ <div class="form-group">+ <div class="col-md-3 col-sm-3 text-right">+ <admin-label asp-for="DisplayOrder" class="control-label" />+ </div>+ <div class="col-md-9 col-sm-9">+ <admin-input asp-for="DisplayOrder" />+ <span asp-validation-for="DisplayOrder"></span>+ </div>+ </div>+ </div><div class="form-actions"><div class="row"><div class="offset-md-3 offset-sm-3 col-md-9 col-sm-9">diff --git a/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentPlugin.cs b/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentPlugin.csindex 618bf0469..86f3718d3 100644--- a/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentPlugin.cs+++ b/src/Plugins/Payments.CashOnDelivery/CashOnDeliveryPaymentPlugin.cs@@ -60,6 +60,7 @@ namespace Payments.CashOnDeliveryawait this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.AdditionalFeePercentage.Hint", "Determines whether to apply a percentage additional fee to the order total. If not enabled, a fixed value is used.");await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.ShippableProductRequired", "Shippable product required");await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.ShippableProductRequired.Hint", "An option indicating whether shippable products are required in order to display this payment method during checkout.");+ await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.SkipPaymentInfo", "Skip payment info");await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.DisplayOrder", "Display order");@@ -81,6 +82,7 @@ namespace Payments.CashOnDeliveryawait this.DeletePluginTranslationResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.AdditionalFeePercentage.Hint");await this.DeletePluginTranslationResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.ShippableProductRequired");await this.DeletePluginTranslationResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.ShippableProductRequired.Hint");+ await this.DeletePluginTranslationResource(_translationService, _languageService, "Plugins.Payment.CashOnDelivery.SkipPaymentInfo");await base.Uninstall();}diff --git a/src/Plugins/Payments.CashOnDelivery/Manifest.cs b/src/Plugins/Payments.CashOnDelivery/Manifest.csindex 5e15ee430..0e8fbc9c9 100644--- a/src/Plugins/Payments.CashOnDelivery/Manifest.cs+++ b/src/Plugins/Payments.CashOnDelivery/Manifest.cs@@ -8,5 +8,5 @@ using Payments.CashOnDelivery;SystemName = CashOnDeliveryPaymentDefaults.ProviderSystemName,SupportedVersion = GrandVersion.SupportedPluginVersion,Author = "grandnode team",- Version = "1.00"+ Version = "1.01")]\ No newline at end of filediff --git a/src/Plugins/Payments.CashOnDelivery/Models/ConfigurationModel.cs b/src/Plugins/Payments.CashOnDelivery/Models/ConfigurationModel.csindex 35dc21ad4..0f335aa2c 100644--- a/src/Plugins/Payments.CashOnDelivery/Models/ConfigurationModel.cs+++ b/src/Plugins/Payments.CashOnDelivery/Models/ConfigurationModel.cs@@ -30,7 +30,9 @@ namespace Payments.CashOnDelivery.Models[GrandResourceDisplayName("Plugins.Payment.CashOnDelivery.DisplayOrder")]public int DisplayOrder { get; set; }-+ [GrandResourceDisplayName("Plugins.Payment.CashOnDelivery.SkipPaymentInfo")]+ public bool SkipPaymentInfo { get; set; }+public IList<ConfigurationLocalizedModel> Locales { get; set; }#region Nested class