parse_json

parse_json filter will convert a string into JSON object.

Example

{% capture order %}
 {
   "id": "531341221233",
   "name": "RF412",
   "customer": {
     "first_name": "Adam",
     "last_name": "Smith"
  }
 }
{% endcapture $}

{% assign order = order | parse %}

{{ "Order name is" | append: order["name"] | log }}

Last updated