Skip to main content

Sitecore Commerce – XC9 Tips – Missing Commerce Components in SXA Toolbox on Experience Editor

I've recently had an issue that commerce components were missing in SXA Toolbox. I setup Sitecore Commerce on top of an existing instance and I already had a SXA website working on it. The idea was to add commerce components and functionality to my existing website.

But after commerce setup, the toolbox was still showing default SXA components and commerce components were missing although I add commerce tenant and website modules:


I checked Available Renderings under Presentation folder, there was no problem, commerce renderings were there. I created another tenant and website to see if it shows the commerce components in toolbox. Nothing seemed different but I was seeing commerce components for new website and it was missing on existing one.

Then, I noticed two things:

1- Selected catalog was empty in content editor (/sitecore/Commerce/Catalog Management/Catalogs) even if I see Habitat_Master catalog in Merchandising section on commerce management panel.

2- Bootstrap request in Postman was giving 500 Internal Server Error.

I checked the logs on Authoring server and I saw this error:

16 09:53:57 ERROR Connection id ""0HLL8B6A07B7H"", Request id ""0HLL8B6A07B7H:00000001"": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery header value "X-XSRF-TOKEN" is not present.
   at Microsoft.AspNetCore.Antiforgery.Internal.DefaultAntiforgery.<ValidateRequestAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

I needed to check two things:

1-  SSL certificate verification should be OFF in Postman (File > Settings). It was already configured correctly on my case.


2- "AntiForgeryEnabled" should be "false" in config.json file (C:\inetpub\wwwroot\CommerceAuthoring_local\wwwroot)

3- Recycle Authoring app pool from IIS

After I did these steps, bootstrap request worked properly.


This steps also fixed the issues I saw in content editor and experience editor. I was able to see Habitat_Master in Selected Catalogs.

And I saw commerce components in toolbox:

Comments

  1. hello,
    i'm facing the same issue, after installing the sitecore commerce (Sitecore.Commerce.2018.12-2.4.63), i didn't see the commerce components. commerce renderings available in the presentation folder.

    i don't have the authoring error. i still updated the config.json. after recycle the pool, i didn't see the commerce component.

    any suggestion?

    ReplyDelete
  2. Can you please help me to run the postman script.

    ReplyDelete
    Replies
    1. Hi,

      What response you get when you run "Bootstrap()" request?

      I was getting 500 internal error and after changing "AntiForgeryEnabled" configuration I started to get 200 success response.

      Delete
  3. i'm unable to run the bootstrap() request? what url i pass in postman? what are are the values for OpsApIHost and OpsApi?

    ReplyDelete
  4. in content editor, under /sitecore/Commerce/Catalog Management/Catalogs, i can see the habitat_master in the selected catalog. see below screenshot.

    https://www.screencast.com/t/hPwBrbgS


    when i tried to create a site, i only see the following module for languages, other commerce module are not showing.

    https://www.screencast.com/t/bZAgTYdB

    ReplyDelete
    Replies
    1. I wrote down the steps in an another post.

      Hope it helps:
      https://dogabenli.blogspot.com/2019/04/sitecore-commerce-xc9-tips-configuring.html

      Delete

Post a Comment

Popular posts from this blog

Modern Observability for Sitecore 10.4 on AKS: Grafana, Alloy, Loki, and Prometheus

In this post, I’ll walk through how I extended the base Sitecore XM 10.4 AKS setup with a modern observability stack using Grafana, Alloy, Loki, and Prometheus. This setup provides deep insights into both infrastructure and application health, with powerful log aggregation and visualization. Project Overview Base:  Sitecore XM 10.4 running on Azure Kubernetes Service (AKS) Enhancements:  Added a full Grafana observability stack: Grafana  for dashboards and visualization Alloy  (Grafana Alloy, formerly Promtail) for log collection and multiline parsing Loki  for log aggregation and querying Prometheus  for metrics collection All configuration...

Sitecore 9 - Creating Custom Marketing Automation Activity Part-2

I am going to build user interface part of custom activity. As we saw in previous post, we have a parameter called "ProcessLimit" in activity implementation. So, we should provide a UI to marketing managers that can set it from marketing automation panel. I don't want to repeat the official documentation, I will only show some key parts. I started with creating package.json file. When you follow official documentation, you see that you need those packages as required. @angular/core: 5.2.11 @angular/http: 5.2.11 @ngx-translate/core: 9.0.2 rxjs: 5.5.11 You will get warning in terminal if there is any package missing, I added step by step and my final package.json file was like this: { "name" : "package" , "version" : "1.0.0" , "description" : "Playground Demo" , "private" : true , "angular-cli" : {}, "scripts" : { "dev" : "ngc -p ....