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.

Commit

KrzysztofPajak17515d270257
diff --cc src/Web/Grand.Web/Views/Shared/SidebarWishlist.cshtml
index ddd1a3dd0,f716c4aff..5043a6c6d
--- a/src/Web/Grand.Web/Views/Shared/SidebarWishlist.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/SidebarWishlist.cshtml
@@@ -7,8 -7,8 +7,8 @@@
<ul class="sidebar-cart wishlist px-0">
<li class="nav-item">
<a href="#" target="_self" class="nav-link">
- <b-icon icon="heart" :variant="[darkMode ? 'white' : 'dark']" @@click="updateWishlist()" v-b-toggle.sidebar-wishlist></b-icon>
+ <b-icon icon="heart" :variant="[darkMode ? 'white' : 'dark']" @@click="updateWishlist('@Url.RouteUrl("Wishlist")')" v-b-toggle.sidebar-wishlist></b-icon>
- <span class="qty-indicator wishlist-qty">
+ <span class="qty-indicator wishlist-qty" ref="wishlistQty">
@Loc["Wishlist.HeaderQuantity", Model]
</span>
</a>
diff --cc src/Web/Grand.Web/wwwroot/theme/script/app.js
index fe69606cb,d3df35a6b..51625a057
--- a/src/Web/Grand.Web/wwwroot/theme/script/app.js
+++ b/src/Web/Grand.Web/wwwroot/theme/script/app.js
@@@ -240,38 -242,46 +242,43 @@@
this.flycartfirstload = false
))
},
- updateWishlist: function () {
- if (parseInt(vm.$refs.wishlistQty.innerText) > 0) {
- this.loader = true;
- axios({
- baseURL: '/wishlist',
- method: 'get',
- data: null,
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'X-Response-View': 'Json'
- }
- }).then(response => (
- this.loader = false,
- this.flywish = response.data,
- this.wishlistitems = response.data.Items,
- this.wishindicator = response.data.Items.length
- ))
- }
+ updateWishlist: function (url) {
+ axios({
+ baseURL: url,
+ method: 'get',
+ data: null,
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-Response-View': 'Json'
+ }
+ }).then(response => (
++ this.loader = false,
+ this.flywish = response.data,
+ this.wishlistitems = response.data.Items,
+ this.wishindicator = response.data.Items.length
+ ))
},
getCompareList: function () {
- axios({
- baseURL: '/compareproducts',
- method: 'get',
- params: {
- t: new Date().getTime()
- },
- data: null,
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'X-Response-View': 'Json'
- }
- }).then(response => {
- this.compareproducts = response.data
- })
+ if (this.compareProductsQty > 0) {
+ this.loader = true;
+ axios({
+ baseURL: '/compareproducts',
+ method: 'get',
+ params: {
+ t: new Date().getTime()
+ },
+ data: null,
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-Response-View': 'Json'
+ }
+ }).then(response => {
+ this.loader = false;
+ this.compareproducts = response.data
+ })
+ }
},
removeFromCompareList: function (id) {
if (id !== undefined) {