<script>console.log({{ product | json }});</script> |
tanks!!!!!
Thanks!!
saved my life!
Thx !
Nice xừ!
Someone might need this for the string log.
<script>console.log({{ image | img_url: 'master' }}");</script>
Thank you very much!
Thx! It works. But not everywhere. E.g. in product-template.liquid I was able to get the log when inserting it above the div with the product description:
<script>console.log({{ product | json }});</script>
<div class="product-single__description rte">
{{ product.description }}
</div>
Thanks a lot!
What are you doing when you have larger objects and JSON isn't allowed?
Shopify/liquid#1153
json not allowed for this object
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.
Thanks
Good job
thanks so much!
This will log an object to the developer console for debugging