{% sw_extends '@Storefront/storefront/base.html.twig' %}
{% block base_main %}
{{ parent() }}
{% block checkout_com_base_main %}
{% set METHOD_TYPE_APPLE_PAY = staticFuncCall('Cko\\Shopware6\\Handler\\Method\\ApplePayHandler::getPaymentMethodType') %}
{% set METHOD_TYPE_GOOGLE_PAY = staticFuncCall('Cko\\Shopware6\\Handler\\Method\\GooglePayHandler::getPaymentMethodType') %}
{% set applePayActive = false %}
{% set googlePayActive = false %}
{% for payment in page.salesChannelPaymentMethods %}
{% if payment.customFields.checkoutConfig.methodType == METHOD_TYPE_APPLE_PAY %}
{% set applePayActive = true %}
{% block checkout_com_base_main_sales_channel_apple_pay_direct %}
{% sw_include '@CkoShopware6/storefront/checkout-com/component/apple/apple-pay-direct.html.twig' %}
{% endblock %}
{% elseif payment.customFields.checkoutConfig.methodType == METHOD_TYPE_GOOGLE_PAY %}
{% set googlePayActive = true %}
{% block checkout_com_base_main_sales_channel_google_pay_direct %}
{% sw_include '@CkoShopware6/storefront/checkout-com/component/google/google-pay-direct.html.twig' %}
{% endblock %}
{% endif %}
{% endfor %}
{% block checkout_com_base_main_sales_channel_apple_pay_display %}
{% sw_include '@CkoShopware6/storefront/checkout-com/component/apple/apple-pay-display.html.twig' with {active: applePayActive} %}
{% endblock %}
{% block checkout_com_base_main_sales_channel_google_pay_display %}
{% sw_include '@CkoShopware6/storefront/checkout-com/component/google/google-pay-display.html.twig' with {active: googlePayActive} %}
{% endblock %}
{% endblock %}
{% endblock %}