Display Guest Customer ID on the cart page.

2 weeks ago
NC 3.90

How can I display the ID of a GUEST CUSTOMER?

The idea is this: sometimes there are some customers who need exact items and they add those items to their carts and ask us to check availability. Then we ask them for this ID and in admin side we quickly check items they want (in current carts).

How can we do it? Or any ideas?

Thanks.
2 weeks ago
I have modified on Default view, If you have theme then you have to do same over there.
@model ShoppingCartModel
@using Nop.Web.Models.Checkout
@using Nop.Web.Models.ShoppingCart;
@using Nop.Core;
@using Nop.Core.Infrastructure;
@using Nop.Core.Domain.Customers;
@{
  Layout = "~/Views/Shared/_ColumnsOne.cshtml";

  //title
  Html.AddTitleParts(T("PageTitle.ShoppingCart").Text);
  //page class
  Html.AppendPageCssClassParts("html-shopping-cart-page");

  var customerId = 0;
  var workContext = EngineContext.Current.Resolve<IWorkContext>();
  if (workContext.CurrentCustomer.IsGuest())
  {
    customerId = workContext.CurrentCustomer.Id;
  }
}
@if (!Model.OnePageCheckoutEnabled)
{
@Html.Action("CheckoutProgress", "Checkout", new {step = CheckoutProgressStep.Cart})
}
<div class="page shopping-cart-page">
  <div class="page-title">
    <h1>
      @T("ShoppingCart")
      @if (customerId > 0)
      {
        <text> - Your Id for Query: @customerId</text>
      }
    </h1>
  </div>
  <div class="page-body">
    @Html.Partial("OrderSummary", Model)
  </div>
</div>

2 weeks ago
I am using nopCommerce 3.90

Will this work for NC 3.90?
2 weeks ago
Yes, I gave you solution/modification for nopCommerce 3.90.