custom/plugins/mediameetsFbPixel/src/Resources/views/storefront/base.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/base.html.twig' %}
  2. {% block base_body_script %}
  3.     {% block mediameets_fb_pixel_plugin_options %}
  4.         {% with %}
  5.             {% if config('mediameetsFbPixel.config.pixelIds') and config('mediameetsFbPixel.config.pixelIds') is not empty %}
  6.                 {% set pluginConfig = config('mediameetsFbPixel.config') %}
  7.                 {% set customerCsrfToken = sw_csrf('frontend.mediameetsFbPixel.customer', {"mode": "token"}) %}
  8.                 {% if shopware.csrfMode is same as ('ajax') %}
  9.                     {% set customerCsrfToken = null %}
  10.                 {% endif %}
  11.                 {% set csrfToken = sw_csrf('frontend.mediameetsFbPixel.conversionApi', {"mode": "token"}) %}
  12.                 {% if shopware.csrfMode is same as ('ajax') %}
  13.                     {% set csrfToken = null %}
  14.                 {% endif %}
  15.                 {% set pluginOptions = {
  16.                     'config': {
  17.                         'pixelIds': pluginConfig.pixelIds,
  18.                         'privacyMode': pluginConfig.privacyMode,
  19.                         'autoConfig': pluginConfig.autoConfig,
  20.                         'advancedMatching': pluginConfig.advancedMatching,
  21.                         'includeShippingCosts': pluginConfig.includeShippingCosts,
  22.                         'useConversionApi': pluginConfig.useConversionApi,
  23.                         'disablePushState': pluginConfig.disablePushState,
  24.                         'conversionApiDeduplication': pluginConfig.conversionApiDeduplication
  25.                     },
  26.                     'shop': {
  27.                         'controller': controllerName|lower,
  28.                         'action': controllerAction|lower,
  29.                         'currency': context.currency.isoCode
  30.                     },
  31.                     'routes': {
  32.                         'customer': path('frontend.mediameetsFbPixel.customer'),
  33.                         'store-api.cart': path('store-api.checkout.cart.read'),
  34.                         'store-api.order': path('store-api.order')
  35.                     },
  36.                     'tokens': {
  37.                         'customer': customerCsrfToken
  38.                     },
  39.                     'conversionApi': {
  40.                         'endpoint': path('frontend.mediameetsFbPixel.conversionApi'),
  41.                         'token': csrfToken
  42.                     }
  43.                  } %}
  44.                 <div data-mediameets-facebook-pixel-options='{{ pluginOptions|json_encode }}'></div>
  45.             {% endif %}
  46.         {% endwith %}
  47.     {% endblock %}
  48.     {{ parent() }}
  49. {% endblock %}