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

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 visit the

A React Example in Sitecore

That's true, Sitecore components are useful and provide lots of facilities. They allow to build fully flexible website. And there is not much problem using post-backs to display your contents. However, if your website has user interactions, then it could be a headache. Too many post-backs would occur a poor user experience. That's why client-side technologies are really powerful and popular for a long time. There are plenty of javascript libraries and frameworks which all try to provide better user experience in different ways. It is not a topic of this article why I chose React. There are some good articles about it (e.g. Jonne Kats' great article ). However, one of the reasons is React only focus on view part. It is not a fully framework like Angular, it is rich featured library instead. And that's what I was looking for! The idea was to benefit Sitecore server-side and React client-side power. It seems they are very good match! Let's dive into code... I&#

Sitecore 9 - Creating Custom Segmentation Rule

Predicates are important to create rules for marketing automation and segmented lists. Before going through the details, I am going to remind what I am implementing again. 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.  According to my scenario, I need a rule to filter contacts who visits a movie more than X time. Maybe, we can add one more condition there like in Y days. To creating rule will give flexibility to marketing managers that then they can easily add or remove multiple rules and proceed the