templates/google_analytics/products.html.twig line 1

Open in your IDE?
  1. {% for product in event.products %}
  2.     {% if product is not empty %}
  3.         {
  4.         {% if product.name is not empty %}
  5.             'name': '{{ product.name|replace({"'": "'"}) }}',
  6.         {% endif %}
  7.         {% if product.price is not empty %}
  8.             'price': '{{ product.price }}',
  9.         {% endif %}
  10.         {% if product.brand is not empty %}
  11.             'brand': '{{ product.brand }}',
  12.         {% endif %}
  13.         {% if product.category is not empty %}
  14.             'category': '{{ product.category }}',
  15.         {% endif %}
  16.         {% if product.variant is not empty %}
  17.             'variant': '{{ product.variant }}',
  18.         {% endif %}
  19.         {% if product.position is not empty %}
  20.             'position': '{{ product.position }}',
  21.         {% endif %}
  22.         {% if product.list is not empty %}
  23.             'list': '{{ product.list }}',
  24.         {% endif %}
  25.         {% if product.quantity is not empty %}
  26.             'quantity': '{{ product.quantity }}',
  27.         {% endif %}
  28.         {% if product.coupon is not empty %}
  29.             'coupon': '{{ product.coupon }}',
  30.         {% endif %}
  31.         'id': '{{ product.id }}'
  32.         }{% if loop.index < event.products|length %},{% endif %}
  33.     {% endif %}
  34. {% endfor %}