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>
This commit is contained in:
2026-02-28 10:23:09 +01:00
parent 01b807a769
commit c9c99a6b88
17 changed files with 551 additions and 15 deletions

View File

@@ -0,0 +1,32 @@
{#
# Product Search Form (Bootstrap 5 Override)
#
# Renders the WooCommerce product search form as a Bootstrap 5 input-group.
#
# Expected context:
# index - Unique form index (for multiple search forms on a page)
#
# WooCommerce PHP equivalent: product-searchform.php
#
# @package WcBootstrap
# @since 0.1.0
#}
{% set field_id = 'woocommerce-product-search-field-' ~ (index|default(0)) %}
<form role="search" method="get" class="woocommerce-product-search" action="{{ home_url('/') }}">
<label class="visually-hidden" for="{{ field_id }}">{{ __('Search for:') }}</label>
<div class="input-group">
<input type="search"
id="{{ field_id }}"
class="form-control"
placeholder="{{ __('Search products&hellip;') }}"
value="{{ get_search_query() }}"
name="s" />
<button type="submit" class="btn btn-outline-primary" aria-label="{{ __('Search') }}">
<i class="bi bi-search" aria-hidden="true"></i>
<span class="d-none d-sm-inline ms-1">{{ __('Search') }}</span>
</button>
</div>
<input type="hidden" name="post_type" value="product" />
</form>