When a customer registers for an account in a store, the customer is only associated with the that store, but stores can be configured to allow customers from other stores to log in. This allows customer accounts to be shared across multiple stores.
CSRs (Customer Service Representative) can be assigned permissions to specific stores to manage its customers.
CustomerAuthenticationDaoImpl- authentication class to retrieve customer accounts. Modified to filter accounts that were not registered to private stores
CustomerImpl- Customer class, updated to include reference to the store where the customer was registered
CheckoutServiceImpl- used when creating accounts on checkout
CustomerService- Updated for retrieving customers by store
CustomeSearchCriteria- Holds the search fields in a customer search from CM
CustomerQueryComposer- Composes the query string from the CustomerSearchCriteria fields
CustomerIndexBuildService- Builds the customer index, sets the fields to be indexed. (Modified to include the store code)
CustomerDetailsProfileRegistrationSection- displays customer registration details. Will show registered store if store is private
How it works
When creating/editing a store, the CSR can pick the other stores to allow logins from.
Customers are attached to store they first registered with by setting the current store to the customer object.
CheckoutCreateAccountFormController, the current store is set for the new customer accounts.
Customers must always be created within the context of an existing store.
CustomerServicechecks for duplicates to ensure that there are no customer records in the database with the same store and UserId/Email.
When logging in to a store,
CustomerAuthenticationDaoImplretrieves all the matching customer usernames in the database for the store and all stores with which it shares customers.
The customer is able to log in if a record is found in this list.
When looking for customers by user ID/email through the
CustomerService, we need to pass the store code.
The code then filters by the store and the store’s associated stores.
In the CM customer search, the search can be filtered by store.
The CM user can only search in the stores where they have permissions.
Customers can create orders in different stores. All orders are saved in the same database, so each order has a store property to indicated where is the order been created. The store property is shown on the order receipt and order view pages as well as in the order confirmation email.
In the Commerce Manager Order Search view, a CSR can filter orders by store. CSRs with permission to search for orders in all stores can choose to search in a particular store or in all stores where they have permissions. CSRs without the appropriate permissions can only search in the stores assigned to them.
OrderImpl- Add the store property and persist it
CheckoutServiceImpl- Save the store property when create the order
checkout\receipt.vm- Show the store property on oder receipt page
checkout\orderDetail.vm- Show the store property on order view page
email\orderConf.html.vm- Show the store property on order confirmation email
OrderSearchCriteria- Holds the search fields in the CM order search form
OrderQueryComposer- Composes the query string from the OrderSearchCriteria fields
ISearchTab- List the available stores in the search view
FulfillmentPermissions- Define the permission whether CSR can search on all the stores
OrderSearchResultsView- Show the store property on the search results list view
OrderSummaryOverviewSectionPart- Show the store property on the order summary page
How it works
CheckoutService, when creating the order, the system keep the store property for the order.
- The order property will be shown on the order receipt page, order view page and order confirmation email in the store.
- In the CM order search, the search can be filtered by store.
- If CSRs have permission to search the orders on all stores, they can choose to search orders either on a particular store or on all the stores. If CSRs don’t have the permission, they can only search by the stores assigned to them.