Solved

Ways to assign values to theme options declared at settings_schema.json without the customizer.

Superfunk
Shopify Partner
44 4 6

Hi, I have a question.

Is it possible to assign values to the theme options declared at settings_schema.json without using the theme customizer?

Or should I stick to the theme switching feature available with the Launchpad app?

The main issue if the latter is the only possibility is that I have 12 different scenarios to apply based on a specific set of dates, meaning that 12 different themes should be enabled to be successfully managed through Launchpad.

And that implies a problem because if the slightest change should be made, let's say, changing the font on one specific span, or the color on one specific div, or the background on one specific p, this change should be made across all the 12 different themes, OR I'd have to rely on a tool like jQuery to make the change dynamically (meaning that the overall loading time of the DOM would be increased anyways).

All this was provoked because I can no longer nest snippets with render (unlike with include) and I'm switching to a new theme that is fully backed up by Shopify, although they don't directly give support to it (Warehouse, Maestrooo).

Accepted Solution (1)

gina-gregory
Shopify Expert
742 51 211

This is an accepted solution.

I would look for a way to swap out your changes using javascript. This may mean setting up theme settings for each of your 12 scenarios. For example, output all the theme settings (liquid) into a JSON array, and then use javascript to use the right set of settings.

View solution in original post

Replies 2 (2)

gina-gregory
Shopify Expert
742 51 211

This is an accepted solution.

I would look for a way to swap out your changes using javascript. This may mean setting up theme settings for each of your 12 scenarios. For example, output all the theme settings (liquid) into a JSON array, and then use javascript to use the right set of settings.

Superfunk
Shopify Partner
44 4 6

Thank you very much Gina, for taking a bit of time to read this.

I've already seen this answer before, to be specific, here. I was expecting that things could have changed a bit from Feb 2020 to Jan 2021, but it seems that that's not the case.

I will declare all the values I need and then invoke the values I need through JS, just as you've said.

Wish me luck, good day.