You've already forked wc-bootstrap
67 lines
2.5 KiB
Twig
67 lines
2.5 KiB
Twig
|
|
{#
|
||
|
|
# Billing Form (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# Renders billing address fields within a Bootstrap card.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# checkout - WC_Checkout object with:
|
||
|
|
# .get_checkout_fields('billing') - Array of billing field configs
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: checkout/form-billing.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
<div class="woocommerce-billing-fields">
|
||
|
|
<div class="card shadow-sm mb-4">
|
||
|
|
<div class="card-header">
|
||
|
|
<h3 class="h5 mb-0">{{ __('Billing details') }}</h3>
|
||
|
|
</div>
|
||
|
|
<div class="card-body">
|
||
|
|
{{ do_action('woocommerce_before_checkout_billing_form', checkout) }}
|
||
|
|
|
||
|
|
<div class="woocommerce-billing-fields__field-wrapper row g-3">
|
||
|
|
{% if billing_fields is defined %}
|
||
|
|
{% for key, field in billing_fields %}
|
||
|
|
{{ woocommerce_form_field(key, field, checkout.get_value(key)) }}
|
||
|
|
{% endfor %}
|
||
|
|
{% endif %}
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_after_checkout_billing_form', checkout) }}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{# Account creation fields (for guest checkout) #}
|
||
|
|
{% if checkout.is_registration_enabled() is defined and checkout.is_registration_enabled() and not is_user_logged_in() %}
|
||
|
|
{% if checkout.is_registration_required() is not defined or not checkout.is_registration_required() %}
|
||
|
|
<div class="woocommerce-account-fields mb-4">
|
||
|
|
<div class="form-check mb-3">
|
||
|
|
<input class="form-check-input"
|
||
|
|
type="checkbox"
|
||
|
|
name="createaccount"
|
||
|
|
id="createaccount"
|
||
|
|
value="1"
|
||
|
|
{{ checkout.get_value('createaccount') ? 'checked' : '' }} />
|
||
|
|
<label class="form-check-label" for="createaccount">
|
||
|
|
{{ __('Create an account?') }}
|
||
|
|
</label>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
{% endif %}
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_before_checkout_registration_form', checkout) }}
|
||
|
|
|
||
|
|
<div class="create-account collapse{% if checkout.get_value('createaccount') %} show{% endif %}">
|
||
|
|
{% if account_fields is defined %}
|
||
|
|
{% for key, field in account_fields %}
|
||
|
|
{{ woocommerce_form_field(key, field, checkout.get_value(key)) }}
|
||
|
|
{% endfor %}
|
||
|
|
{% endif %}
|
||
|
|
</div>
|
||
|
|
|
||
|
|
{{ do_action('woocommerce_after_checkout_registration_form', checkout) }}
|
||
|
|
{% endif %}
|
||
|
|
</div>
|