{% sw_extends '@Storefront/storefront/layout/footer/footer.html.twig' %}
{% block layout_footer_vat %}
{% set pickupOnly = context.customer.customFields['custom_shippingCosts_pickupOnly'] %}
{% set freeShippingThreshold = pickupOnly ? 0 : context.context.extensions.deliveryInformations['freeShippingThreshold'] %}
{% set defaultThreshold = constant('Proc\\ProcOrderSimulate\\Subscriber\\OrderSimulateSubscriber::EUR_THRESHOLD') %}
{% if freeShippingThreshold > 0 %}
<div class="footer-vat">
{% if context.taxState == "gross" %}
<p>
{{ "proc.footer.includeVatAndFreeShippingThreshold"|trans({
'%freeShippingThreshold%': freeShippingThreshold|default(defaultThreshold)|floatval|currency,
'%url%': path('frontend.cms.page',
{ id: config('core.basicInformation.shippingPaymentInfoPage'),})
})|raw }}
</p>
{% else %}
<p>
{{ "proc.footer.excludeVatAndFreeShippingThreshold"|trans({
'%freeShippingThreshold%': freeShippingThreshold|default(defaultThreshold)|floatval|currency,
'%url%': path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage'),})
})|raw }}
</p>
{% endif %}
</div>
{% else %}
<div class="footer-vat">
{% if context.taxState == "gross" %}
<p>
{{ "footer.includeVat"|trans({
'%url%': path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') })
})|raw }}
</p>
{% else %}
<p>
{{ "footer.excludeVat"|trans({
'%url%': path('frontend.cms.page',{ id: config('core.basicInformation.shippingPaymentInfoPage') })
})|raw }}
</p>
{% endif %}
</div>
{% endif %}
{% endblock %}