Files
wc-bootstrap/templates/checkout/review-order.html.twig
magdev 6ee95f4a2f
All checks were successful
Create Release Package / PHP Lint (push) Successful in 57s
Create Release Package / Build Release (push) Successful in 1m11s
Fix template quirks and bump version to 0.1.0
Audit and fix 14 Twig templates for escaping bugs, CSS conflicts,
and missing Bootstrap styling:
- Fix nl2br/esc_html filter order in order details
- Add WC gallery modifier classes for zoom/photoswipe JS init
- Fix HTML entity double-encoding in headings (up-sells, cross-sells, related)
- Remove wrong 'is defined' guards on function calls
- Remove duplicate deprecated hooks in dashboard
- Add |raw to brand description HTML filter chain
- Add role="alert" for accessibility, |esc_attr on notification types
- Style mini-cart remove button as Bootstrap btn
- Make shipping form-check class conditional
- Add shop_table CSS reset and gallery opacity fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:50:19 +01:00

92 lines
3.5 KiB
Twig

{#
# 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() %}
{{ 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>