1

I'm able to add Tags to a customer in Biztool. I can't see any method in Sitecore.Commerce.Services.Customers where I can insert Tags to customer record.

Please let me know if I need to override methods to do so or if there is any easy way to make it work.

Any help will be appreciated.

Thanks.

2

There is no OOTB method that can do it, you need to customise it.

Start from looking into RegisterUser method in Sitecore.Commerce.XA.Foundation.Connect.Managers.IAccountManager, Sitecore.Commerce.XA.Foundation.Connect.

This method calls the commerce.customers.createUser pipeline and this pipeline calls a pipeline processor Sitecore.Commerce.Engine.Connect.Pipelines.Customers.CreateUser, Sitecore.Commerce.Engine.Connect that creates a customer in commerce engine.

The code in the processor

  • Gets an entity view for the customer from commerce engine, an entity view contains the property collection which you can set, (this is similar to BizFx where you click Add button for a customer)
  • Then it sets the specific property with values received in request, e.g. DomainName, LoginName etc.
  • Then it calls a DoAction API operation to save it in commerce engine.

Copy the existing processor code and replace with your copied one and debug it, it will give you good idea.

You need to send your tags details in the "Tags" property.

It depends on your specific scenario that how much you need to customize but you can replace the AccountManager implementation with yours as well if needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.