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

Deploying SolrCloud with Zookeeper on Azure Kubernetes Service (AKS)

SolrCloud on Azure Kubernetes Service (AKS) Running SolrCloud on Kubernetes — particularly Azure Kubernetes Service (AKS) — can provide you with a highly scalable, cost-efficient, and cloud-native architecture.  This guide walks through how I deployed SolrCloud 8.11.2 with Zookeeper on AKS . Why This Matters for Sitecore Deployments If you're running Sitecore XP or XM , you know that Solr is a mandatory dependency — powering xDB indexing, content search. While Sitecore provides a developer-friendly Solr container for local use, it clearly states: ⚠️ The included Solr image is intended only for development and testing . This means Sitecore does not provide a production-ready Solr setup. If you're deploying Sitecore in production — especially in Kubernetes — you need to create your own scalable, HA SolrCloud cluster. That’s why this deployment matters: You’re building a production-grade SolrCloud setup You’re deploying 3 Solr + 3 Zookeeper nodes for high availabilit...

Sitecore 9 - Custom Page Events & Filtering with XConnect

This is the first article of a series. I am going to start with creating a custom page event and will show how we can fetch event data using xconnect api. Let's start with reminding demo scenario: Imagine that you have a website displaying movies. Visitors are able to see movie details and take some actions like save movie or share it.  You want to follow the visitors' activities and you want to take some marketing actions based on those activities. For example, if a contact visits a movie more than X time or she/he saves a movie, you want to send those movies to an external system. In addition, there is going to be a limit to send same movie. Such as, it will not be possible to send same movie more than 2 times.  You want to configure this as a marketing automation plan to give flexibility to your marketing managers. They should be able to add configurable rules and activities.  My first focus is movie detail page. I want to track visitors when they visi...