Seller-assisted buying
Seller-assisted buying lets a store administrator log in as a customer and act on their behalf by browsing products, building a cart, and placing orders. During the session, a banner tells the administrator they are browsing as the customer. Afterward, the customer can review every administrator action in their account activity log.
Seller-assisted buying is not a separate drop-inNPM packages that provide core Commerce storefront features such as cart, checkout, product details, and account flows. or package. It extends three drop-ins you already have and adds a session banner to the boilerplatePre-configured storefront with the components and services you need to get started..
How it works
Section titled “How it works”When seller-assisted buying is enabled at the store level, an administrator generates a one-time password (OTP) in the Admin. The administrator uses the OTP to sign in as the customer through the standard storefront sign-in flow. The storefront-auth drop-in decodes the returned JSON Web Token (JWT) and checks it for an admin identifier. When the token includes an admin identifier, the drop-in sets an auth_dropin_admin_session cookie.
The boilerplate header block reads that cookie on every page load. When the cookie is present, the block renders the session banner. The banner listens to the authenticated event and removes itself when the session ends. See Session banner for the UI details and CSS classes.
If remote shopping assistance is disabled at the store level, both the settings block and the activity block display a feature-disabled message rather than their normal UI.
Where each part is documented
Section titled “Where each part is documented”Because the feature spans several drop-ins, each piece lives with the drop-in it belongs to:
- Consent checkbox on the sign-up form — User Auth — SignUp container and the
RemoteShoppingAssistanceConsentslot. To relabel the checkbox or change its tooltip text, go to Stores > Settings > Configuration > Customers > Login as Customer in the Admin. - Customer preference control (
commerce-seller-assisted-buying-settings) — User Account — SellerAssistedBuyingSettings container - Administrator activity log (
commerce-seller-assisted-buying-activity) — User Account — SellerAssistedBuyingActivity container - Order label in the orders list — User Account — OrdersList container
- Order label on the order status page — Order — OrderStatus container
- Functions and data models — User Account — Functions
- Text and labels — User Account — Dictionary and Order — Dictionary
- CSS classes — User Account — Styles
Session banner
Section titled “Session banner”
The session banner lives in the boilerplate header block, not in a drop-in. It renders automatically when an admin session is active. You don’t need to add any code. The banner shows the customer’s name and the website name, and includes a “Close Session” button that calls revokeCustomerToken() and redirects to the home page. The CSS and rendering logic ship with the header block (blocks/header/header.css and blocks/header/renderSellerAssistedBuyingBanner.js).
Target these classes to restyle the banner:
/* Adds top padding to page content so the banner does not overlap it */body:has(.seller-assisted-buying-banner) {}
/* Banner strip — rendered at the top of the page during an assisted session */.seller-assisted-buying-banner {}.seller-assisted-buying-banner__message {}.seller-assisted-buying-banner__close-button {}If you change the banner height, update body:has(.seller-assisted-buying-banner) at the same time so the page content shifts down by the same amount.