Looking for a way to query for the Wishlist and private messaging in nopCommerce 4.2

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hello,

I am working on a single page theme for nopCommerce4.2.  I was able to get the  user Authentication like this:
@{
@using Nop.Core.Domain.Customers
var isAuthenticated = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Core.IWorkContext>().CurrentCustomer.IsRegistered();
}

I would also like to be able to query for the Private Message and Wishlist as well, but can't find the proper method to call for them.  Any ideas on getting those values for a query?

            @if (AllowPrivateMessages)
            {
                <li>
                    <a href="@Url.RouteUrl("PrivateMessages", new { tab = "" })" class="ico-inbox">
                        <span class="inbox-label">@T("PrivateMessages.Inbox")</span>
                        <span class="inbox-unread">@Model.UnreadPrivateMessages</span>
                    </a>
                </li>
            }
            @if (WishlistEnabled)
            {
                <li>
                    <a href="@Url.RouteUrl("Wishlist")" class="ico-wishlist">
                        <span class="wishlist-label">@T("Wishlist")</span>
                        <span class="wishlist-qty">@T("Wishlist.HeaderQuantity", Model.WishlistItems)</span>
                    </a>
                </li>
            }
4 years ago
So this code is from nopCommerce42\Presentation\Nop.Web\Views\Shared\Components\HeaderLinks\Default.cshtml
The values for those fields in the model are populated in PrepareHeaderLinksModel()
in nopCommerce42\Presentation\Nop.Web\Factories\CommonModelFactory.cs
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.