Impersonate user

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
How do I impersonate a user?
13 年 前
Go to a customer details page (admin area), then 'Place order' tab and click 'Place order' button.
9 年 前
Quick write up here.
How can a sales person enter an order through the Administration section?
6 年 前
Hello,

I have a view that I show my customers to 12 PM on A friday. I have that piece of code in their and all works well.

What I would like to know is, is there a way I can impersonate the client and nop picks up that I am actually the admin and allows me to see the view.

So basically:

IF it is after 12 pm = Dont let the customer see

IF it is after 12 pm and the customer is being impersonated by the admin, still let them see

Is that possible? Is there a function/service I can query to check this :)
6 年 前
var isImpersonating = _workContext.OriginalCustomerIfImpersonated != null;

If using above in a View (.cshtml file), you will need to resolve the _workContext.
6 年 前
Great, thanks :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.