You've already forked wc-bootstrap
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>
This commit is contained in:
40
templates/global/sidebar.html.twig
Normal file
40
templates/global/sidebar.html.twig
Normal file
@@ -0,0 +1,40 @@
|
||||
{#
|
||||
# Shop Sidebar (Bootstrap 5 Override)
|
||||
#
|
||||
# Renders the WooCommerce shop sidebar using Bootstrap 5 offcanvas for mobile
|
||||
# and a standard aside column for desktop.
|
||||
#
|
||||
# Expected context:
|
||||
# sidebar_content - Pre-rendered sidebar widget HTML (from get_sidebar('shop'))
|
||||
#
|
||||
# WooCommerce PHP equivalent: global/sidebar.php
|
||||
#
|
||||
# @package WcBootstrap
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
{% if sidebar_content is defined and sidebar_content %}
|
||||
{# Mobile: offcanvas trigger button (visible below lg breakpoint) #}
|
||||
<button class="btn btn-outline-secondary d-lg-none mb-3"
|
||||
type="button"
|
||||
data-bs-toggle="offcanvas"
|
||||
data-bs-target="#shopSidebar"
|
||||
aria-controls="shopSidebar">
|
||||
<i class="bi bi-funnel" aria-hidden="true"></i>
|
||||
{{ __('Filters') }}
|
||||
</button>
|
||||
|
||||
{# Mobile: offcanvas panel #}
|
||||
<div class="offcanvas offcanvas-start offcanvas-lg"
|
||||
tabindex="-1"
|
||||
id="shopSidebar"
|
||||
aria-labelledby="shopSidebarLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 class="offcanvas-title" id="shopSidebarLabel">{{ __('Filters') }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ __('Close') }}"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
{{ sidebar_content|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user