Commit Graph

13 Commits

Author SHA1 Message Date
c5f8e88ee4 Fix single product layout conflicts with WooCommerce CSS
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>
2026-02-28 18:25:01 +01:00
7fda8e1962 Add Bootstrap 5 single product page layout
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>
2026-02-28 17:55:39 +01:00
00872a6568 Add Bootstrap 5 product archive with card grid and sidebar
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 &ndash; 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>
2026-02-28 15:06:33 +01:00
7034134678 Polish My Account templates with Bootstrap 5 patterns
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>
2026-02-28 13:28:15 +01:00
c3b16b68c5 Fix unstyled pages: rename base.html.twig to avoid parent collision
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>
2026-02-28 12:29:20 +01:00
46eb7f0a22 Add WooCommerce-to-Twig rendering bridge
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>
2026-02-28 11:15:59 +01:00
49b1d52701 Implement Phase 9 & reusable components; skip Phase 8 (emails)
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>
2026-02-28 10:53:44 +01:00
8b1793097c Implement Phase 6 & 7: My Account and Order Details templates (Bootstrap 5, HPOS)
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>
2026-02-28 10:43:30 +01:00
594d810439 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
9917105951 Implement Phase 3: single product page templates (Bootstrap 5)
Add 21 Twig template overrides for the single product page:

Product layout:
- product-image: gallery with thumbnail strip, img-fluid rounded
- title: h1 entry-title
- price: fs-3 fw-bold with sale del/ins markup
- short-description: lead text-body-secondary
- meta: dl row with SKU, categories, tags
- rating: Bootstrap Icon stars with half-star, review count link
- stock: badge (bg-success/bg-danger/bg-warning) per status
- sale-flash: badge bg-danger fs-6
- share: hook-only wrapper
- product-attributes: table-sm table-striped

Related/upsells:
- related, up-sells: section with product loop grid

Tabs:
- tabs: nav-tabs + tab-content with fade transitions
- description: tab-pane with prose content
- additional-information: tab-pane with attributes hook

Add to cart (4 product types + variation JS):
- simple: input-group quantity + btn-primary btn-lg
- variable: form-select per attribute + variation display
- grouped: table-borderless with quantity per child product
- external: btn-outline-primary with external link icon
- variation: Underscore.js script templates (Bootstrap-styled)
- variation-add-to-cart-button: quantity + submit with hidden fields

CSS additions: gallery thumbnail hover, variation selector spacing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:28:13 +01:00
c9c99a6b88 Implement Phase 2: product archive and shop loop templates (Bootstrap 5)
Add 15 Twig template overrides for the product archive and shop loop:
- archive-product: 3+9 grid layout with optional filter sidebar
- content-product: card component with hook-based content injection
- content-product-cat: category card with thumbnail
- product-searchform: input-group with search icon button
- loop/loop-start, loop-end: responsive row-cols grid
- loop/header: archive title with description hook
- loop/result-count: showing X-Y of Z with aria-relevant
- loop/orderby: form-select-sm sort dropdown
- loop/pagination: delegates to components/pagination.html.twig
- loop/no-products-found: alert-info empty state
- loop/add-to-cart: btn-primary-sm with AJAX data attributes
- loop/price: fw-semibold with sale/regular markup
- loop/rating: Bootstrap Icon stars (full, half, empty)
- loop/sale-flash: badge bg-danger positioned overlay

CSS additions: product card hover, sale badge z-index, star rating sizing,
price del/ins styling, WooCommerce grid reset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:23:09 +01:00
01b807a769 Implement Phase 1: global templates and notices (Bootstrap 5)
Add 9 Twig template overrides for WooCommerce's global and notice templates:
- global/wrapper-start, wrapper-end: conditional container with _theme_wrapped
- global/breadcrumb: Bootstrap breadcrumb component with aria-current
- global/sidebar: offcanvas-lg for mobile, standard aside for desktop
- global/quantity-input: input-group with +/- buttons
- global/form-login: responsive form with form-control, form-check
- notices/notice, error, success: Bootstrap alert-dismissible with icons

Supporting changes:
- assets/js/quantity.js: +/- button handler respecting min/max/step
- assets/css/wc-bootstrap.css: WooCommerce notice fallback styles, spinner removal
- functions.php: register quantity.js script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:19:10 +01:00
399354b7d2 Initial theme scaffold from wp-theme-template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 09:42:35 +01:00