You've already forked wc-bootstrap
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>
36 lines
1006 B
PHP
36 lines
1006 B
PHP
<?php
|
|
/**
|
|
* Single Product Page (Bootstrap 5 Layout)
|
|
*
|
|
* Renders the WooCommerce single product content. This file is NOT included
|
|
* directly by WordPress. Instead, it is captured via output buffering by
|
|
* wc_bootstrap_render_single_product() and injected into the parent theme's
|
|
* page shell (pages/page.html.twig). Therefore it does NOT call
|
|
* get_header()/get_footer() or render the wrapper hooks.
|
|
*
|
|
* @package WcBootstrap
|
|
* @since 0.1.0
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* Hook: woocommerce_before_main_content.
|
|
*
|
|
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
|
|
* @hooked woocommerce_breadcrumb - 20
|
|
*/
|
|
do_action( 'woocommerce_before_main_content' );
|
|
|
|
while ( have_posts() ) {
|
|
the_post();
|
|
wc_get_template_part( 'content', 'single-product' );
|
|
}
|
|
|
|
/**
|
|
* Hook: woocommerce_after_main_content.
|
|
*
|
|
* @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
|
|
*/
|
|
do_action( 'woocommerce_after_main_content' );
|