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.

Minor changes with View - update urls on the checkout page

support171399bf14dd
diff --git a/src/Web/Grand.Web/Views/Checkout/Start.cshtml b/src/Web/Grand.Web/Views/Checkout/Start.cshtml
index d176ecec8..ee941a9b1 100644
--- a/src/Web/Grand.Web/Views/Checkout/Start.cshtml
+++ b/src/Web/Grand.Web/Views/Checkout/Start.cshtml
@@ -6,6 +6,7 @@
<script asp-location="Footer" asp-src="/theme/script/public.checkout.js" asp-order="300"></script>
<script asp-location="Footer" asp-order="301">
+ vmorder.vCartUrl.init('@Url.RouteUrl("ShoppingCartSummary")', '@Url.RouteUrl("ShoppingCartTotal")');
vmorder.vShipping.init('#co-shipping-form', '/checkout/SaveShipping/');
vmorder.vBilling.init('#co-billing-form', '/checkout/SaveBilling/');
vmorder.vShippingMethod.init('#co-shipping-method-form', '/checkout/SaveShippingMethod/');
diff --git a/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js b/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
index a14fd3c25..3dd1bf90c 100644
--- a/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
+++ b/src/Web/Grand.Web/wwwroot/theme/script/public.checkout.js
@@ -46,6 +46,7 @@ var vmorder = new Vue({
acceptTerms: false,
// checkout steps methods
Checkout: null,
+ vCartUrl: null,
vShipping: null,
vBilling: null,
vShippingMethod: null,
@@ -302,6 +303,19 @@ var vmorder = new Vue({
},
};
},
+ vmCartUrl(){
+ this.vCartUrl = {
+ urlCartSummary: false,
+ urlCartTotal: false,
+
+ init: function (urlCartSummary, urlCartTotal) {
+ this.urlCartSummary = urlCartSummary;
+ this.urlCartTotal = urlCartTotal;
+ vmorder.updateCart();
+ vmorder.updateTotals();
+ },
+ }
+ },
vmShipping() {
this.vShipping = {
form: false,
@@ -686,7 +700,7 @@ var vmorder = new Vue({
saveUrl: false,
isSuccess: false,
- init: function (saveUrl, successUrl) {
+ init: function (saveUrl, successUrl) {
this.saveUrl = saveUrl;
this.successUrl = successUrl;
},
@@ -749,7 +763,7 @@ var vmorder = new Vue({
},
updateCart() {
axios({
- baseURL: '/cart/summary/',
+ baseURL: this.vCartUrl.urlCartSummary,
method: 'get',
data: null,
headers: {
@@ -763,7 +777,7 @@ var vmorder = new Vue({
},
updateTotals() {
axios({
- baseURL: '/cart/total/',
+ baseURL: this.vCartUrl.urlCartTotal,
method: 'get',
data: null,
headers: {
@@ -834,6 +848,7 @@ var vmorder = new Vue({
}
},
created() {
+ this.vmCartUrl();
this.vmCheckout();
this.vmShipping();
this.vmBilling();
@@ -841,8 +856,6 @@ var vmorder = new Vue({
this.vmPaymentMethod();
this.vmPaymentInfo();
this.vmConfirmOrder();
- this.updateCart();
- this.updateTotals();
this.cartView();
this.otherScripts();
},