Display Guest Customer ID on the cart page.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 年 前
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 年 前
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 年 前
I am using nopCommerce 3.90

Will this work for NC 3.90?
2 年 前
Yes, I gave you solution/modification for nopCommerce 3.90.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.