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>
WooCommerce's layout CSS fought Bootstrap's grid in three ways:
1. Float-based two-column layout (width: 48% + float) on div.images
and div.summary squeezed content inside our col-lg-6 columns.
Reset with float: none; width: 100%.
2. Nested content wrapper (.container + #primary + <main>) from
woocommerce_output_content_wrapper doubled up on the parent
theme's existing .container. Remove the hooks entirely.
3. Sale badge (position: absolute; top: -.5em; z-index: 9) escaped
the image column and blocked breadcrumb clicks. Override to
top: 0.5em; z-index: 1 and use gx-* (horizontal-only gutters)
to avoid negative margin-top on the .row.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add two-column responsive grid (image gallery + product summary) for
single product pages, following the same bridge pattern used for
product archives.
Key changes:
- Create content-single-product.php bridge and Twig layout template
- Add single product renderer at template_redirect priority 11
- Disable WooCommerce block compatibility layer that strips classic
hooks when parent theme has theme.json
- Move PHP templates to woocommerce/ subfolder for cleaner structure
- Fix Twig templates to self-compute context data not passed by
wc_get_template() (tabs, short-description, meta, rating)
- Fix Underscore.js triple-brace syntax conflict in variation template
by wrapping in {% verbatim %}
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace WooCommerce's default shop/category page rendering with a
Bootstrap 5 card grid layout featuring responsive columns, sale badges,
star ratings, and an offcanvas sidebar for filters on mobile.
Key implementation details:
- Bypass parent theme's TemplateController for product archives via
wp_bootstrap_should_render_template filter, render at template_redirect
priority 11 using the same page shell injection pattern as plugin pages
- Add archive-product.php (Bootstrap layout with optional sidebar) and
content-product.php (PHP bridge for wc_get_template_part interception)
- Inject global $product into Twig context in TemplateOverride to fix
empty price/add-to-cart/rating/sale-flash in loop sub-templates — Twig
has isolated variable scopes and cannot access PHP globals directly
- Fix pagination URLs: use get_pagenum_link() instead of ?page= query
param (WordPress uses 'paged' for archive pagination, not 'page')
- Fix double-escaped – in result count by adding |raw filter
- Reset WooCommerce float-based layout CSS (woocommerce-layout.css) for
shop pages to prevent conflicts with Bootstrap flex grid
- Register shop-sidebar widget area with Bootstrap-styled markup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Correct wc-bootstrap-overrides stylesheet dependency from unregistered
'woocommerce' handle to 'woocommerce-general'. Update README directory
structure to reflect wc-base.html.twig rename and .env-dist location.
Add Fixed section to CHANGELOG.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Intercept WooCommerce's PHP template loading via
woocommerce_before_template_part / woocommerce_after_template_part hooks
to render Bootstrap 5 Twig templates instead. This makes all 99 child
theme templates functional in a standard WooCommerce environment.
- Create WooCommerceExtension (Twig AbstractExtension) with ~50 functions
and 7 filters covering WC API, WordPress hooks, escaping, and forms
- Rewrite TemplateOverride to use hook-based interception with stack-based
output buffering for nested template support
- Wire bridge initialization at init priority 20 in functions.php
- Fix invalid {% do return() %} in two order templates
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>