templates/google_analytics/items_v4.html.twig line 1

Open in your IDE?
  1. {% for item in event.items %}
  2.     {% if item is not empty %}
  3.         {
  4.             'item_id': '{{ item.id }}',
  5.             {% if item.itemName is not empty %}
  6.                 'item_name': '{{ item.itemName|replace({"'": "'"}) }}',
  7.             {% endif %}
  8.             {% if item.quantity is not empty %}
  9.                 'quantity': '{{ item.quantity }}',
  10.             {% endif %}
  11.             {% if item.price is not empty %}
  12.                 'price': '{{ item.price }}',
  13.             {% endif %}
  14.             {% if item.coupon is not empty %}
  15.                 'coupon': '{{ item.coupon }}',
  16.             {% endif %}
  17.         }
  18.         {% if loop.index < event.items|length %},{% endif %}
  19.     {% endif %}
  20. {% endfor %}