{# # Payment Methods (Bootstrap 5 Override) # # Shows saved payment methods on the account page. # # WooCommerce PHP equivalent: myaccount/payment-methods.php # # @package WcBootstrap # @since 0.1.0 #} {% set saved_methods = wc_get_customer_saved_methods_list(get_current_user_id()) %} {% set has_methods = saved_methods is not empty %} {{ do_action('woocommerce_before_account_payment_methods', has_methods) }} {% if has_methods %}
{% for column_id, column_name in wc_get_account_payment_methods_columns() %} {% endfor %} {% for type, methods in saved_methods %} {% for method in methods %} {% for column_id, column_name in wc_get_account_payment_methods_columns() %} {% endfor %} {% endfor %} {% endfor %}
{{ column_name|esc_html }}
{% if column_id == 'method' %} {% if method.method.last4 is defined and method.method.last4 %} {{ __('%1$s ending in %2$s')|format(wc_get_credit_card_type_label(method.method.brand)|esc_html, method.method.last4|esc_html) }} {% else %} {{ wc_get_credit_card_type_label(method.method.brand)|esc_html }} {% endif %} {% if method.is_default|default(false) %} {{ __('Default') }} {% endif %} {% elseif column_id == 'expires' %} {{ method.expires|esc_html }} {% elseif column_id == 'actions' %}
{% for key, action in method.actions %} {{ action.name|esc_html }} {% endfor %}
{% else %} {{ do_action('woocommerce_account_payment_methods_column_' ~ column_id, method) }} {% endif %}
{% else %} {% endif %} {{ do_action('woocommerce_after_account_payment_methods', has_methods) }} {% if fn('WC').payment_gateways.get_available_payment_gateways() is not empty %} {{ __('Add payment method') }} {% endif %}