20 czerwca 2018 05:29:38

Moving shopping cart in bootstrap theme

Avatar
  • Wysłany: 9 months ago
We bought the bootstrap theme and we want to modify this theme to our needs.

One of the things we want to change is the location of the shopping cart. At the moment this one is located in the top menu (next to Register, Log in, Wishlist etc). We want to move this next to the search bar(like your other theme: http://theme13.nopcommerce.pl).

Do you have any sugestions to do this because the views (AdminHeaderLinks.cshtml and HeaderLinks.cshtml) and models (AdminHeaderLinksModel and HeaderLinksModel) are diffrent.

Thanks.
0
Avatar
  • Wysłany: 9 months ago
  • Moderator
Hello,


Thanks for reaching us. You can do it with:

You can use this part of code, paste it in the Header.cshtml


@using Nop.Core.Infrastructure;
                                    @using Nop.Web.Framework.Themes;
                                    @using Nop.Core;
                                    @using Nop.Services.Localization;
                                    @using Nop.Services.Orders;
                                    @{
                                        var storeContext = EngineContext.Current.Resolve<Nop.Core.IStoreContext>();
                                        var customerCartItemNumber = EngineContext.Current.Resolve<Nop.Core.IWorkContext>().CurrentCustomer.ShoppingCartItems.Where(x => x.ShoppingCartType == Nop.Core.Domain.Orders.ShoppingCartType.ShoppingCart)
                                                        .LimitPerStore(storeContext.CurrentStore.Id)
                                                        .ToList()
                                                        .GetTotalProducts();
                                    }
@Html.Action("FlyoutShoppingCart", "ShoppingCart")
0
back to top