Skip to content

Instantly share code, notes, and snippets.

@veganista
Created April 20, 2016 10:56
Show Gist options
  • Star 61 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save veganista/8aa555a1a9f313642db076b823ce7cb1 to your computer and use it in GitHub Desktop.
Save veganista/8aa555a1a9f313642db076b823ce7cb1 to your computer and use it in GitHub Desktop.
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@veganista
Copy link
Author

I accessed the properties of the object until it allowed me to do it in my last project.

For example...

<script>console.log({{ product.images | json }});</script>

When I first posted this product supported JSON, but I guess now it doesn't.

This snippet was a quick way of me examining the object without looking at the docs, maybe not quite as useful now.

@gdSuhail
Copy link

gdSuhail commented Jun 2, 2022

Thanks

@luongh0202
Copy link

Good job

@philipvella
Copy link

thanks so much! 🙇 🙌

@ylmzpath
Copy link

really thanx!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment