Files
wc-bootstrap/templates/checkout/review-order.html.twig

92 lines
3.6 KiB
Twig
Raw Normal View History

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>
2026-02-28 10:33:49 +01:00
{#
# Order Review Table (Bootstrap 5 Override)
#
# Renders the order summary table during checkout.
#
# Expected context:
# cart_items - Array of cart items for review
# cart_subtotal - Subtotal HTML
# cart_total - Total HTML
# coupons - Applied coupons
# fees - Fees
#
# WooCommerce PHP equivalent: checkout/review-order.php
#
# @package WcBootstrap
# @since 0.1.0
#}
<div class="card shadow-sm woocommerce-checkout-review-order-table">
<div class="card-body p-0">
<table class="table table-sm mb-0 shop_table woocommerce-checkout-review-order-table">
<thead class="table-light">
<tr>
<th class="product-name" scope="col">{{ __('Product') }}</th>
<th class="product-total text-end" scope="col">{{ __('Subtotal') }}</th>
</tr>
</thead>
<tbody>
{{ do_action('woocommerce_review_order_before_cart_contents') }}
{% if cart_items is defined %}
{% for item in cart_items %}
<tr class="cart_item">
<td class="product-name">
{{ item.product_name|esc_html }}
<strong class="product-quantity text-body-secondary">&times;&nbsp;{{ item.quantity }}</strong>
{{ item.item_data_html|default('')|raw }}
</td>
<td class="product-total text-end">
{{ item.subtotal|raw }}
</td>
</tr>
{% endfor %}
{% endif %}
{{ do_action('woocommerce_review_order_after_cart_contents') }}
</tbody>
<tfoot>
<tr class="cart-subtotal">
<th scope="row">{{ __('Subtotal') }}</th>
<td class="text-end">{{ cart_subtotal|raw }}</td>
</tr>
{% if coupons is defined %}
{% for coupon in coupons %}
<tr class="cart-discount coupon-{{ coupon.code|esc_attr }}">
<th scope="row">{{ __('Coupon:') }} {{ coupon.code|esc_html }}</th>
<td class="text-end">{{ coupon.discount_html|raw }}</td>
</tr>
{% endfor %}
{% endif %}
{{ do_action('woocommerce_review_order_before_shipping') }}
{% if wc_shipping_enabled() is defined and wc_shipping_enabled() %}
{{ do_action('woocommerce_review_order_shipping') }}
{% endif %}
{{ do_action('woocommerce_review_order_after_shipping') }}
{% if fees is defined %}
{% for fee in fees %}
<tr class="fee">
<th scope="row">{{ fee.name|esc_html }}</th>
<td class="text-end">{{ fee.total_html|raw }}</td>
</tr>
{% endfor %}
{% endif %}
{{ do_action('woocommerce_review_order_before_order_total') }}
<tr class="order-total">
<th scope="row" class="fw-bold">{{ __('Total') }}</th>
<td class="text-end fw-bold fs-5">{{ cart_total|raw }}</td>
</tr>
{{ do_action('woocommerce_review_order_after_order_total') }}
</tfoot>
</table>
</div>
</div>