{% load currency_filters l10n %}

{% if cookie_jar.settings.facebook_pixel and cookie_jar.facebook.is_allowed %}
    <script>
        fbq('track', 'InitiateCheckout', {
            currency: "{{ basket.currency }}",
            value: {{ order_total.incl_tax|unlocalize|escapejs }},
            content_ids: [{% for line in basket.all_lines %}
                "{{line.product.upc}}",
            {% endfor %}],
            content: [{% for line in basket.lines.all %}
                "{{line.product.title}}",
            {% endfor %}],
        });
    </script>
{% endif %}