Skip to content

Commit a0eddec

Browse files
committed
Merge branch 'issue-8086-navbar-wishlist-count-not-showing-for-custom-wishlist-items' into 4.90-bug-fixes
2 parents 5cb964b + a71bf00 commit a0eddec

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Libraries/Nop.Services/Orders/NopOrderDefaults.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ public static partial class NopOrderDefaults
3434
/// {3} : product ID
3535
/// {4} : created from date
3636
/// {5} : created to date
37+
/// {6} : custom wishlist ID
3738
/// </remarks>
38-
public static CacheKey ShoppingCartItemsAllCacheKey => new("Nop.shoppingcartitem.all.{0}-{1}-{2}-{3}-{4}-{5}");
39+
public static CacheKey ShoppingCartItemsAllCacheKey => new("Nop.shoppingcartitem.all.{0}-{1}-{2}-{3}-{4}-{5}-{6}");
3940

4041
/// <summary>
4142
/// Gets a key pattern to clear cache
@@ -45,7 +46,6 @@ public static partial class NopOrderDefaults
4546
/// </remarks>
4647
public static string ShoppingCartItemsByCustomerPrefix => "Nop.shoppingcartitem.all.{0}";
4748

48-
4949
#endregion
5050

5151
#region Perform order with lock

src/Libraries/Nop.Services/Orders/ShoppingCartService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ public virtual async Task<IList<ShoppingCartItem>> GetShoppingCartAsync(Customer
794794
if (createdToUtc.HasValue)
795795
items = items.Where(item => createdToUtc.Value >= item.CreatedOnUtc);
796796

797-
return await _shortTermCacheManager.GetAsync(async () => await items.ToListAsync(), NopOrderDefaults.ShoppingCartItemsAllCacheKey, customer, shoppingCartType, storeId, productId, createdFromUtc, createdToUtc);
797+
return await _shortTermCacheManager.GetAsync(async () => await items.ToListAsync(), NopOrderDefaults.ShoppingCartItemsAllCacheKey, customer, shoppingCartType, storeId, productId, createdFromUtc, createdToUtc, customWishlistId);
798798
}
799799

800800
/// <summary>

src/Presentation/Nop.Web/Factories/CommonModelFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,14 @@ public virtual async Task<HeaderLinksModel> PrepareHeaderLinksModelAsync()
352352
UnreadPrivateMessages = unreadMessage,
353353
AlertMessage = alertMessage,
354354
};
355+
355356
//performance optimization (use "HasShoppingCartItems" property)
356357
if (customer.HasShoppingCartItems)
357358
{
358359
model.ShoppingCartItems = (await _shoppingCartService.GetShoppingCartAsync(customer, ShoppingCartType.ShoppingCart, store.Id))
359360
.Sum(item => item.Quantity);
360361

361-
model.WishlistItems = (await _shoppingCartService.GetShoppingCartAsync(customer, ShoppingCartType.Wishlist, store.Id))
362+
model.WishlistItems = (await _shoppingCartService.GetShoppingCartAsync(customer, ShoppingCartType.Wishlist, store.Id, customWishlistId: 0))
362363
.Sum(item => item.Quantity);
363364
}
364365

0 commit comments

Comments
 (0)