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.

wishlist & cart - minor changes

DanielŻuławski175f152669cb
diff --git a/src/Web/Grand.Web/Views/ShoppingCart/_ModelScript.cshtml b/src/Web/Grand.Web/Views/ShoppingCart/_ModelScript.cshtml
index bb3b286e4..298595741 100644
--- a/src/Web/Grand.Web/Views/ShoppingCart/_ModelScript.cshtml
+++ b/src/Web/Grand.Web/Views/ShoppingCart/_ModelScript.cshtml
@@ -106,9 +106,13 @@
});
},
getModel() {
+ var date = new Date().getTime();
axios({
method: 'get',
- url: '@Url.RouteUrl("ShoppingCart")',
+ params: {
+ 'timestamp': date
+ },
+ baseURL: '@Url.RouteUrl("ShoppingCart")',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
diff --git a/src/Web/Grand.Web/Views/Wishlist/_ModelScript.cshtml b/src/Web/Grand.Web/Views/Wishlist/_ModelScript.cshtml
index 52f93843f..30c89d83a 100644
--- a/src/Web/Grand.Web/Views/Wishlist/_ModelScript.cshtml
+++ b/src/Web/Grand.Web/Views/Wishlist/_ModelScript.cshtml
@@ -74,12 +74,13 @@
})
},
getModel() {
- var url = window.location.href;
- url = new URL(url);
- url.searchParams.set('timestamp', new Date().getTime());
+ var date = new Date().getTime();
axios({
- baseURL: url,
method: 'get',
+ params: {
+ 'timestamp': date
+ },
+ baseURL: '@Url.RouteUrl("Wishlist")',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
@@ -94,10 +95,6 @@
}
document.querySelector('.wishlist-qty').innerHTML = total;
}
- }).then(function () {
- var stateurl = new URL(url);
- stateurl.searchParams.delete('timestamp');
- window.history.replaceState({ path: stateurl.href }, '', stateurl.href);
});
},
displayWarning(message, variant, title) {