You've already forked wc-bootstrap
47 lines
1.9 KiB
Twig
47 lines
1.9 KiB
Twig
|
|
{#
|
||
|
|
# Single Payment Method (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# Renders a payment gateway as a list-group-item with radio and description.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# gateway - WC_Payment_Gateway object with:
|
||
|
|
# .id - Gateway ID
|
||
|
|
# .get_title() - Gateway title
|
||
|
|
# .get_icon() - Gateway icon HTML
|
||
|
|
# .has_fields() - Whether gateway has inline fields
|
||
|
|
# .get_description() - Gateway description
|
||
|
|
# .chosen - Whether this is the selected gateway
|
||
|
|
# .payment_fields() - Renders inline payment fields
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: checkout/payment-method.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
<li class="wc_payment_method payment_method_{{ gateway.id|esc_attr }} list-group-item">
|
||
|
|
<div class="form-check">
|
||
|
|
<input type="radio"
|
||
|
|
class="form-check-input input-radio"
|
||
|
|
name="payment_method"
|
||
|
|
id="payment_method_{{ gateway.id|esc_attr }}"
|
||
|
|
value="{{ gateway.id|esc_attr }}"
|
||
|
|
data-order_button_text="{{ gateway.order_button_text|default('')|esc_attr }}"
|
||
|
|
{% if gateway.chosen is defined and gateway.chosen %}checked{% endif %} />
|
||
|
|
|
||
|
|
<label class="form-check-label d-flex align-items-center gap-2" for="payment_method_{{ gateway.id|esc_attr }}">
|
||
|
|
<span>{{ gateway.get_title()|esc_html }}</span>
|
||
|
|
{{ gateway.get_icon()|raw }}
|
||
|
|
</label>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{% if gateway.has_fields() or gateway.get_description() %}
|
||
|
|
<div class="payment_box payment_method_{{ gateway.id|esc_attr }} mt-2 ps-4{% if not gateway.chosen|default(false) %} d-none{% endif %}">
|
||
|
|
{% if gateway.get_description() %}
|
||
|
|
<p class="small text-body-secondary mb-2">{{ gateway.get_description()|wp_kses_post }}</p>
|
||
|
|
{% endif %}
|
||
|
|
{{ gateway.payment_fields() }}
|
||
|
|
</div>
|
||
|
|
{% endif %}
|
||
|
|
</li>
|