Największy zbiór rozszerzeń do nopCommerce

19 listopada 2017 08:47:17
2 months ago #134 Cytat
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.
2 months ago #135 Cytat
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")
---
Best regards,
Patryk Porabik
nop4you Team