diff --git a/assets/css/wc-bootstrap.css b/assets/css/wc-bootstrap.css index 67de347..ef8308d 100644 --- a/assets/css/wc-bootstrap.css +++ b/assets/css/wc-bootstrap.css @@ -209,10 +209,13 @@ /* ========================================================================== Sale Badge - Positioning for the sale overlay badge on product cards. + Position inside gallery area, not overlapping breadcrumb. + WooCommerce sets top: -.5em which bleeds above the containing block. ========================================================================== */ -.onsale { +.woocommerce span.onsale { + top: 0.5em; + left: 0.5em; z-index: 1; } @@ -263,6 +266,18 @@ border-radius: var(--bs-border-radius); } +/* ========================================================================== + Single Product Layout + Reset WooCommerce's float-based two-column layout for single product pages. + Bootstrap's row/col-lg-6 grid handles the layout instead. + ========================================================================== */ + +.woocommerce div.product div.images, +.woocommerce div.product div.summary { + float: none; + width: 100%; +} + /* ========================================================================== Variation Selectors Spacing for variable product attribute dropdowns. diff --git a/functions.php b/functions.php index 5ca8825..20b4334 100644 --- a/functions.php +++ b/functions.php @@ -271,6 +271,22 @@ function wc_bootstrap_remove_default_sidebar(): void { } add_action( 'init', 'wc_bootstrap_remove_default_sidebar' ); +/** + * Replace WooCommerce's content wrapper with a no-op. + * + * The parent theme's page shell already wraps content in a .container, + * so WooCommerce's default wrapper (another .container + #primary +
) + * creates a double-nested container that constrains width. Remove it and + * let the parent theme handle the outer layout. + * + * @since 0.1.0 + */ +function wc_bootstrap_remove_content_wrappers(): void { + remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); + remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); +} +add_action( 'init', 'wc_bootstrap_remove_content_wrappers' ); + /** * Prevent the parent theme from rendering WooCommerce pages. * diff --git a/templates/content-single-product.html.twig b/templates/content-single-product.html.twig index 6df42ae..e36054e 100644 --- a/templates/content-single-product.html.twig +++ b/templates/content-single-product.html.twig @@ -34,9 +34,9 @@
{# Two-column layout: images left, summary right #} -
+
{# Left column: Sale flash + Product images #} -
+
{{ do_action('woocommerce_before_single_product_summary') }}