NOP v2.80 - Shopping Cart Item Count

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
I'm looking for changing the count in the shopping cart header link. It gives error in the HeadrLinks.cshtml file if I use Model.Items.Count in place of Model.ShoppingCartItems. Please advise.
9 years ago
seetap wrote:
I'm looking for changing the count in the shopping cart header link. It gives error in the HeadrLinks.cshtml file if I use Model.Items.Count in place of Model.ShoppingCartItems. Please advise.


don`t use Model.Items.Count there

in HeadrLinks.cshtml file add something like:
@{
Model.ShoppingCartItems = EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.ShoppingCartItems
        .Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart)
        .LimitPerStore(EngineContext.Current.Resolve<IStoreContext>().CurrentStore.Id)
        .ToList()
        //.GetTotalProducts();
        .Count();
}
3 years ago
a.m. wrote:
Everything works fine as designed. We display the total number (Qty) of ALL products in the cart. It works the same way as in the top "shopping cart (QTY)" link.

Furthermore, flyout shopping cart does not display ALL products in the cart. By default it displays only first 5 products.

If you don't like this behavior you can always change it.


how do i change it? would you answer please?
3 years ago
What version are you using ?
See source43\Presentation\Nop.Web\Views\Shared\Components\FlyoutShoppingCart\Default.cshtml
To change the number displayed in mini shopping cart there is a setting
shoppingcartsettings.minishoppingcartproductnumber currently set at 5
3 years ago
Yidna wrote:
What version are you using ?
See source43\Presentation\Nop.Web\Views\Shared\Components\FlyoutShoppingCart\Default.cshtml
To change the number displayed in mini shopping cart there is a setting
shoppingcartsettings.minishoppingcartproductnumber currently set at 5


I'm using 3.9 & thank's, I got it.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.