Last active
April 29, 2025 10:25
-
-
Save luukee/0d7729db11fa1e9d6c9d544dd6431b8d to your computer and use it in GitHub Desktop.
Shopify metafield dump
This file contains hidden or 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
| {% comment %} | |
| Description: | |
| Snippet to dump the metafields of an objectt in the console | |
| Usage: | |
| {% render 'dump-metafields' with article.metafields.blog.sections %} | |
| or | |
| {% render 'dump-metafields' with article.metafields.custom.sections %} | |
| {% endcomment %} | |
| <script type="text/javascript"> | |
| console.log('Metafields Data:', {{ dump-metafields | map: "value" | json }}); | |
| </script> |
This file contains hidden or 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
| {% comment %} | |
| Description: | |
| Snippet to dump the content of an object in the console | |
| Usage: | |
| {% render 'dump' with [OBJECT] %} | |
| {% endcomment %} | |
| <script type="text/javascript"> | |
| console.log({{ dump | json }}); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment