hey everyone. I am wondering where I can look with...
# suitecommerce
r
hey everyone. I am wondering where I can look within Netsuite to see which context variables are available to my theme, like where that is configured? I cant seem to find where that information is managed. any help would be appreciated
s
Context variables are documented at the bottom of each template. If you want to see the data 'live', you can add the following to your template:
{{log this}}
and it will dump the context variable to the developer console (obvs only do this on your local or test instance)
👍 1
r
I see those, I guess to be more specific, I am wondering how I can pull more data in? or where is the data that is available being pulled from?
I dont know, for example, how to define those context variables
s
The best mechanism is using an extension to invoke the
addToViewContextDefinition()
method attached to various extensibility components. Do you have development experience?
r
I do, just zero experience inside Netsuites environment
if i take your point r.e. the method, would that method be invoked in the Summit theme extension, not the theme files themselves?
s
OK, well at this point I would recommend that you do the basic training for SuiteCommerce web development, because diving into this without it could be problematic. It teaches you how to make these sorts of changes.
👍 1
And no, we wouldn't advise you to make changes to an existing extension, let alone one you don't own. You would create a new extension, and then add in the code you wanted into that.
✔️ 1
But ultimately it all depends on what data you want to get into your template. Perhaps it would be useful if you gave more details about what it is you want to do
✔️ 1
r
I understand your points, and I am enrolled to do some of the training shortly. Essentially, I am updating the layout of our PDP (Product Detail Page), and need to expose 1 or 2 more attributes to the model that is reachable by the page
s
OK, what kind of data though? For example, custom item fields should already be surfaced to your model so long as you add them to your field set
r
custom item fields is exactly what I am looking for. My issue is that I am not sure if there is a place where I can review the model, and confirm the names of the attributes as they are formatted into the model
s
Have you added the field to the right field set and then logged the model to the console yet?
I'm talking about the steps documented here: https://netsuite.custhelp.com/app/answers/detail/a_id/77002
We also have the SC Custom Fields extension which does a lot of this work with configuration
👍 1
r
ah. I had not rebuilt the search index at all after I added the custom field
I will definitely check out the SC Custom Fields extension as well.. we are a site with a lot of custom technical attributes so it is likely we will end up looking to include more custom sets into specific pages
s
The SC Custom Fields extension is probably our most popular extension and with good reason, it covers a lot of common customisation requirements by replacing a task that typically requires development with configuration.
👍 1
It should be the default way of surfacing custom fields, resorting to theme or extension changes when it's not possible through that extension
👍 1
r
makes sense then. I appreciate your patience there mate. I will look at getting that added for sure
s
No worries. I teach people how to develop customisations, but I also teach people how to avoid doing it at all 😉
😂 1
r
'the best process is no process' 😉
s
yeah, "work smart, not hard" and all that
👍 1