You've already forked wc-bootstrap
Implement Phase 4 & 5: cart and checkout templates (Bootstrap 5, HPOS)
Phase 4 - Cart (9 templates): - cart: 8+4 column layout, table-responsive items, coupon input-group - cart-empty: centered empty state with cart-x icon - cart-item-data: inline dl for variation details - cart-totals: card with list-group-flush rows, sticky sidebar - cart-shipping: form-check radio per shipping method - cross-sells: product loop grid section - mini-cart: offcanvas-compatible item list with remove buttons - proceed-to-checkout-button: btn-primary btn-lg w-100 - shipping-calculator: collapsible form with form-select/form-control Phase 5 - Checkout (12 templates): - form-checkout: 7+5 column layout, sticky order review sidebar - form-billing: card with field wrapper, optional account creation - form-shipping: card with ship-to-different-address collapse toggle - form-coupon: collapsible input-group with alert-info toggle - form-login: collapsible login reusing global/form-login.html.twig - review-order: card with table-sm, tfoot subtotal/shipping/total - payment: list-group of payment gateways with radio selection - payment-method: form-check with description collapse - terms: form-check checkbox with T&C link - thankyou: HPOS compatible, alert-success + order details list-group - order-received: confirmation message - cart-errors: alert-danger with return-to-cart button All order data accessed via WC_Order methods (HPOS compatible). CSS additions: cart thumbnail sizing, checkout form field overrides, payment box transitions, dark mode focus states. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
69
templates/checkout/form-shipping.html.twig
Normal file
69
templates/checkout/form-shipping.html.twig
Normal file
@@ -0,0 +1,69 @@
|
||||
{#
|
||||
# Shipping Form (Bootstrap 5 Override)
|
||||
#
|
||||
# Renders shipping address fields with "ship to different address" toggle.
|
||||
#
|
||||
# Expected context:
|
||||
# checkout - WC_Checkout object
|
||||
# shipping_fields - Array of shipping field configs
|
||||
# order_fields - Array of order note fields
|
||||
#
|
||||
# WooCommerce PHP equivalent: checkout/form-shipping.php
|
||||
#
|
||||
# @package WcBootstrap
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
<div class="woocommerce-shipping-fields">
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header">
|
||||
<div class="form-check mb-0">
|
||||
<input class="form-check-input"
|
||||
type="checkbox"
|
||||
name="ship_to_different_address"
|
||||
id="ship-to-different-address-checkbox"
|
||||
value="1"
|
||||
{{ ship_to_different_address|default(false) ? 'checked' : '' }} />
|
||||
<label class="form-check-label h5 mb-0" for="ship-to-different-address-checkbox">
|
||||
{{ __('Ship to a different address?') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body shipping_address collapse{% if ship_to_different_address|default(false) %} show{% endif %}">
|
||||
{{ do_action('woocommerce_before_checkout_shipping_form', checkout) }}
|
||||
|
||||
<div class="woocommerce-shipping-fields__field-wrapper row g-3">
|
||||
{% if shipping_fields is defined %}
|
||||
{% for key, field in shipping_fields %}
|
||||
{{ woocommerce_form_field(key, field, checkout.get_value(key)) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ do_action('woocommerce_after_checkout_shipping_form', checkout) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Order notes #}
|
||||
<div class="woocommerce-additional-fields mb-4">
|
||||
{{ do_action('woocommerce_before_order_notes', checkout) }}
|
||||
|
||||
{% if order_fields is defined and order_fields|length > 0 %}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header">
|
||||
<h3 class="h5 mb-0">{{ __('Additional information') }}</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="woocommerce-additional-fields__field-wrapper">
|
||||
{% for key, field in order_fields %}
|
||||
{{ woocommerce_form_field(key, field, checkout.get_value(key)) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{{ do_action('woocommerce_after_order_notes', checkout) }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user