I am struggling with CMS in SuiteCommerce Standard...
# suitecommerce
a
I am struggling with CMS in SuiteCommerce Standard. Using SMT, I placed a CMS HTML in one of the All Pages slots on the default layout, and that HTML appears everywhere except on My Account pages (where the user goes when they first log in to the Web Store). The JS console shows an error and the Network tab shows a response that says something went wrong with the CMS Content, and I should try deleting it and adding it back in. I deleted all my CMS content by deleting the CMS Content records in the NetSuite UI rather than in SMT (I only had a couple of things) and started over from scratch, making new CMS HTMLs in SMT. The one I put on an All Pages section causes this error again and does not get included or shown on the MyAccount pages, still. It works fine on all other pages. What am I doing wrong? I know I've gotten this to work before, on the MyAccount pages. Why can't I get it to work now?
1
m
Could you please tell me what you have on the variable SC.ENVIRONMENT.CMS ?
In MyAccount
a
Logging in and arriving at the MyAccount Overview page, my JS console in the browser has the following:
Copy code
cms.js:2 
        
        
       GET <https://sb-webstore.alcsource.com/api/cms/v2/contents?path=%2F&pagetype=MyAccountOverview&t=1729795540549&locale=en_US> 400 (Bad Request)
(anonymous) @ cms.js:2
n.get @ cms.js:2
e @ cms.js:2
fetchAndRenderPageContent @ cms.js:2
n.onPageChanged @ cms.js:2
(anonymous) @ cms.js:2
(anonymous) @ cms.js:2
f @ cms.js:2
trigger @ cms.js:2
on @ cms.js:2
n.on @ cms.js:2
T @ cms.js:2
(anonymous) @ cms.js:2
Promise.then
n.bindAllEvents @ cms.js:2
(anonymous) @ cms.js:2
Promise.then
n.init_v3 @ cms.js:2
(anonymous) @ cms.js:2
(anonymous) @ cms.js:2
(anonymous) @ cms.js:2Understand this errorAI
cms.js:2 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'filter')
    at cms.js:2:8186
If I then, in that same browser JS console, type
Copy code
SC.ENVIRONMENT.CMS
Then it outputs:
Copy code
{
  "pages": {
    "pages": []
  },
  "_debug_requestTime": 53
}
If I log out and go to the Home page on the web store, SC.ENVIRONMENT.CMS is
Copy code
{
  "pages": {
    "pages": []
  },
  "_debug_requestTime": 32
}
which looks about the same to me.
m
this is the error that i get when i'm logged in
"message": "Content on this page is missing crucial information. This can happen if you manually edit or delete content records in NetSuite. To correct the problem, in NetSuite, delete the CMS content record with ID 9 and use Site Management Tools to add the content back to the site."
you can search that content id in NS
an the issue only appears when you are loggedin
so it seems that some permissions are missing for the Customer Center rol
Captura de pantalla 2024-10-24 a la(s) 15.52.10.png
i get the correct response when not logged in
Do you have the CMS_HTML permission on your Customer Center Role ?
a
Clarification: I just tried going to Home page while logged in and it has the same issue with the other CMS HTML. So it seems it's not the MyAccount page, but being logged in, that's causing the issue of not being able to load CMS stuff.
m
Yes, that seems a permission issue on the role
a
Okay I'll check the role. Thank you 🙂 what permission does it need? Is it called something like "CMS Content" permission?
m
No, let me send you a screenshot
1
Captura de pantalla 2024-10-24 a la(s) 15.54.54.png
these are the permission that you should set on the Customer Center Role
after changing that, you should log out and login in to take effect
a
Thank you very much. I had to make a new role, as the one I was relying on before is locked and couldn't be changed without creating another custom role from it. I am having trouble finding where the default Role is set that will be assigned to new Web Store users when they register. Do you know where that is?
Found it. It's not in Commerce setup pages; it's in Setup > Company > General Preferences
m
search for p:manage roles
Yes
a
Thank you. That seems to have resolved the problem!
m
Great to hear! 🙂