So a few day ago, i checked that we where able to send some data from the admin panel setting through a schema e.x.:
{% schema %}
{
"name": "button",
"target": "section",
"settings": [
{
"type": "text",
"id": "example_id_one",
"label": "ID 1",
"info": "Text here."
},
{
"type": "text",
"id": "example_id_two",
"label": "ID 2",
"info": "Text here."
}
]
}
{% endschema %}
where we get these variables from the schema by:
<script>
window.ourConfig = window.ourConfig || {};
window.ourConfig.exampleIdOne = '{{ block.settings.example_id_one }}';
window.ourConfig.exampleIdTwo = '{{ block.settings.example_id_two }}';
</script>
which worked completely fine until i was testing our app today, and suddenly the variable that gets example_id_one is empty, and the variable holding example_id_two is example_id_one instead.
And i have tried removing and readding the block, and filling in all the settings as they where, but still get the same issue. And ensuring that i did in fact save the settings, as well as emptying my cache completely and doing hard refreshes of my browser
I have looked through documentation and talked to shopify support without any help, is there anyone who knows why this suddenly started happening? and what the solution would be
Hi @UTRYThomas
To me, it looks like you are defining section settings in the schema, but you try to read them with block.settings ?
Plus, there is no other code for blocks. You do have a loop?
the settings are set in another liquid script that is in our blocks folder for our app, i wasn’t the one to set up this architecture.
what do you mean with loop?
Is it an actual App?
Are these settings in App embed part of Customizer or on template?
If they are in App embed, you should check config/settings_data.json for data similar to this one, but for your app:
"blocks": {
"15683396631634586217": {
"type": "shopify://apps/inbox/blocks/chat/. . .",
"disabled": false,
"settings": {
"button_color": "#000000",
. . .
}
}
If settings are configured in template, check the relevant json under /templates for data like:
"1758635459cad40307": {
"type": "apps",
"blocks": {
"forms_inline_eQVnhW": {
"type": "shopify://apps/forms/blocks/inline/. . .",
"settings": {
"form_id": "431443",
"text_color": "#1878B9",
. . .
}
}
}
And see if this data matches what you see in Customizer, or what you see in rendered HTML.
yes it is an actual app made in JS, so we have previously been able to use the structure that i posted to extract those values from the Admin panel of our app, but they suddenly don’t work anymore.
So we are using the whole shopify app dev from an IDE to test it
I found the solution, so apparently the dev store that we had made is using different templates or something(i did not do this so i couldn’t tell you) so i was filling in the fields in an admin panel for one item, and was in another item page in the dev store preview, and the setttings were not being set across all product pages.