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>
This commit is contained in:
2026-02-28 17:55:39 +01:00
parent 00872a6568
commit 7fda8e1962
11 changed files with 257 additions and 26 deletions

View File

@@ -2,7 +2,8 @@
# Product Short Description (Bootstrap 5 Override)
#
# Expected context:
# short_description - Product short description HTML
# product - WC_Product object (from TemplateOverride)
# short_description - Product short description HTML (optional)
#
# WooCommerce PHP equivalent: single-product/short-description.php
#
@@ -10,7 +11,12 @@
# @since 0.1.0
#}
{% if short_description is defined and short_description %}
{# Compute short description when not passed as context. #}
{% if short_description is not defined %}
{% set short_description = apply_filters('woocommerce_short_description', product.get_short_description()) %}
{% endif %}
{% if short_description %}
<div class="woocommerce-product-details__short-description lead text-body-secondary mb-3">
{{ short_description|raw }}
</div>