Skip to content

Instantly share code, notes, and snippets.

Created April 20, 2016 10:56
What would you like to do?
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
Copy link

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.

Copy link

gdSuhail commented Jun 2, 2022


Copy link

Good job

Copy link

thanks so much! 🙇 🙌

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