3

I am working on Sitecore commerce project where I am customizing the cart and product listing pages.I am trying to debug Sitecore commerce knockout JavaScript and modify the JavaScript necessary in Sitecore commerce.When i try to view SXA storefront pages and inspect the sources loaded on the page, the pages are optimized and bundled so i can not debug it. To disable asset optimizer,, I have tried steps from https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/enable-and-configure-the-asset-optimizer.html and https://www.bugdebugzone.com/2018/07/sitecore-sxa-disable-asset-optimizer.html but none of them are working and I am always seeing the bundled version of JavaScript loaded on to SXA pages.

Can anyone let me know what should i do to disable optimization and see all the sources java scripts loaded from Sitecore themes folder

Here is the screenshot of SXA storefront JS panel

enter image description here

  • did you try adding a query string of ?aodisabled=1 – Richard Seal Jun 3 at 17:33
  • What is the version of Sitecore commerce you are using? – Rama Krshna Ila Jun 3 at 19:25
  • It is sitecore 9 update 3.I tried adding ?aodisabled=1 and it did not work. – Sriram Rakesh Jun 3 at 23:46
1

Since you have tried all the options, the only way to disable optimization of styles and css is to navigate to \App_Config\Modules\SXA\Foundation\Sitecore.XA.Foundation.Theming.config and modify the following value to true and that will let you enable and disable asset optimization switch

<setting name="XA.Foundation.Theming.AssetsOptimizationSwitch.Enabled" Value="true" />

Note, that this switch is only available in SXA version used in Sitecore Commerce 9 Update-3. It is not available in previous versions of Sitecore Commerce.

  • This solution worked finally.Thank you. – Sriram Rakesh Jun 16 at 17:19
2

First of all, try to globally disable asset optimization:

enter image description here

You can also disable it per site:

enter image description here

If you still want to use ?aodisabled=1 ensure that this "switch" is enabled. Take a look at Sitecore.XA.Foundation.Theming.config configuration file and find XA.Foundation.Theming.AssetsOptimizationSwitch.Enabled setting:

enter image description here

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.