Last active
July 20, 2021 14:58
-
-
Save savchukoleksii/072eeb68b2c6249e75e0af7bd79ff696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- assign section_customizer_settings = "" -%} | |
{%- for setting in section.settings -%} | |
{%- capture setting_data -%} | |
"{{- setting -}}": {{- section.settings[setting] | json -}} | |
{%- endcapture -%} | |
{%- if section_customizer_settings != blank -%} | |
{%- assign section_customizer_settings = section_customizer_settings | append: "," -%} | |
{%- endif -%} | |
{%- assign section_customizer_settings = section_customizer_settings | append: setting_data -%} | |
{%- endfor -%} | |
{%- assign section_customizer_settings = "{" | append: section_customizer_settings | append: "}" -%} | |
{%- assign section_customizer_blocks = "" -%} | |
{%- for block in section.blocks -%} | |
{%- assign block_settings = "" -%} | |
{%- for setting in block.settings -%} | |
{%- capture setting_data -%} | |
"{{- setting -}}": {{- block.settings[setting] | json -}} | |
{%- endcapture -%} | |
{%- if block_settings != blank -%} | |
{%- assign block_settings = block_settings | append: "," -%} | |
{%- endif -%} | |
{%- assign block_settings = block_settings | append: setting_data -%} | |
{%- endfor -%} | |
{%- assign block_settings = "{" | append: block_settings | append: "}" -%} | |
{%- capture setting_data -%} | |
{ | |
"id": {{- block.id | json -}}, | |
"type": {{- block.type | json -}}, | |
"shopify_attributes": {{- block.shopify_attributes | json -}}, | |
"settings": {{- block_settings -}} | |
} | |
{%- endcapture -%} | |
{%- endfor-%} | |
{%- assign section_customizer_blocks = "[" | append: section_customizer_settings | append: "]" -%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment