I'm working on AddToCart functionality with a cloned AddToCart commerce rendering. But on clicking Add to cart button, the page is getting loaded.

I have checked the SXA layout but all the JavaScript files related to below media library theme folder are not getting rendered.

  • commerce-core-libraries
  • commerce-services-theme
  • commerce-core-theme
  • commerce-components-theme
  • commerce-main-theme
  • storefront-branded-extension

Please help me to find a solution.

  • is the optimizer on? Have you published the root item of these folder as well? Can you verify if everything is published? Also, i m not sure about the question, clicking add to cart button doesnt do anything? Apr 22 '20 at 19:38

Here are the areas where we should be checking if we see the above error

  1. Make sure the layout used for rendering the page should contain the following code in the body section of layout.

    AssetLinks assetLinks = AssetLinksGenerator.GenerateLinks(new ThemesProvider()); @foreach (string script in assetLinks.Scripts) { @Html.Raw(script) }

  2. All the themes folder for the current site in the media library is published and verified in web database.

  3. The body section in the SXA layout contains @Html.Sxa().Body().Decorate() tag to decorate the sitecore SXA body.


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.