-
-
Save veganista/8aa555a1a9f313642db076b823ce7cb1 to your computer and use it in GitHub Desktop.
<script>console.log({{ product | json }});</script> |
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! 🙇 🙌
really thanx!!!
Nice xừ!