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>
Redesign navigation with endpoint icons, offcanvas-lg responsive
pattern, and sticky sidebar. Replace flat dashboard with card-based
welcome greeting (avatar) and quick-action grid. Wrap all forms
(edit-account, edit-address, lost/reset-password) in card sections
with icon headers. Restructure view-order with summary card and
status badge component. Override WooCommerce's float-based layout
and max-width constraint to let Bootstrap flex grid handle sizing.
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>
The child's templates/base.html.twig was shadowing the parent's
views/base.html.twig (full HTML page shell) because prependPath()
made Twig find the child's minimal wrapper first. Rename to
wc-base.html.twig so the parent's page shell renders correctly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use mariadb:latest and wordpress:php8.4 floating tags
- Add private registry image name (hub.bundespruefstelle.ch/woocommerce)
- Add restart policies (always for prod, unless-stopped for dev)
- Move .env-dist to project root
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Multistage Dockerfile (WooCommerce download, wp-bootstrap npm build,
Composer deps, WordPress runtime), Compose stack with MariaDB, and
auto-setup entrypoint that installs WordPress and activates the theme
on first boot.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- README: document rendering bridge architecture, template coverage,
directory structure, and how the interception pipeline works
- CHANGELOG: comprehensive list of all features added across phases 1-9
- PLAN: update dependencies to reflect completed bridge implementation
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>
Phase 8 (Emails) skipped: WooCommerce email rendering uses
wc_get_template_html() which bypasses the Twig pipeline entirely.
Email customization deferred to plugins or block email editor.
Phase 9 - Supplementary (7 templates):
- Brand description with thumbnail, taxonomy archive delegate
- Brands A-Z shortcode with alphabetical index navigation
- Single brand thumbnail shortcode
- REST API OAuth login and grant-access forms
- Back-in-stock notification form with email input
Reusable Components (6 templates):
- price: product price display with sale handling
- rating: star rating with Bootstrap Icons (filled/half/empty)
- address-card: billing/shipping address card with edit link
- status-badge: contextual order status badges
- quantity-input: +/- input group widget
- form-field: universal form field renderer (text/select/textarea/checkbox)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 6 - My Account (15 templates):
- Account layout with sidebar navigation (list-group) and content area
- Orders table with status badges, pagination, and responsive design
- View order with order notes as list-group items
- Address cards with edit/add buttons
- Login/Register side-by-side card layout
- Account edit, password change, downloads, payment methods forms
- Lost/reset password forms and confirmation
Phase 7 - Order Details (5 templates):
- Order details table with items, totals, and customer note
- Line item rows with refund quantity display
- Customer billing/shipping address cards
- Order tracking form
- Order again button
All order templates use WC_Order object methods only (HPOS compatible).
Bootstrap 5 components: cards, tables, list-groups, badges, forms, alerts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9-phase plan covering all ~125 customer-facing WooCommerce templates,
organized by priority: globals, archive, single product, cart, checkout,
my account, orders, emails, and supplementary. Includes Bootstrap 5
component mappings, CSS/JS strategy, reusable components, accessibility
checklist, and per-file tracking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add constraints section documenting that the woocommerce plugin is read-only
and that the Docker environment is not yet set up. Track composer.lock.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>