You've already forked wc-bootstrap
Fix template quirks and bump version to 0.1.0
Audit and fix 14 Twig templates for escaping bugs, CSS conflicts, and missing Bootstrap styling: - Fix nl2br/esc_html filter order in order details - Add WC gallery modifier classes for zoom/photoswipe JS init - Fix HTML entity double-encoding in headings (up-sells, cross-sells, related) - Remove wrong 'is defined' guards on function calls - Remove duplicate deprecated hooks in dashboard - Add |raw to brand description HTML filter chain - Add role="alert" for accessibility, |esc_attr on notification types - Style mini-cart remove button as Bootstrap btn - Make shipping form-check class conditional - Add shop_table CSS reset and gallery opacity fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,6 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="text">
|
||||
{{ term_description()|wptexturize|wpautop|do_shortcode }}
|
||||
{{ term_description()|wptexturize|wpautop|do_shortcode|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{% if available_methods is defined and available_methods|length > 0 %}
|
||||
<ul id="shipping_method_{{ index|default(0) }}" class="list-unstyled mb-2">
|
||||
{% for method_id, method in available_methods %}
|
||||
<li class="form-check">
|
||||
<li{% if available_methods|length > 1 %} class="form-check"{% endif %}>
|
||||
{% if available_methods|length > 1 %}
|
||||
<input type="radio"
|
||||
name="shipping_method[{{ index|default(0) }}]"
|
||||
@@ -40,7 +40,7 @@
|
||||
class="shipping_method"
|
||||
data-index="{{ index|default(0) }}" />
|
||||
{% endif %}
|
||||
<label class="form-check-label" for="shipping_method_{{ index|default(0) }}_{{ method_id|esc_attr }}">
|
||||
<label class="{{ available_methods|length > 1 ? 'form-check-label' : '' }}" for="shipping_method_{{ index|default(0) }}_{{ method_id|esc_attr }}">
|
||||
{{ method.get_label()|raw }}
|
||||
</label>
|
||||
{{ do_action('woocommerce_after_shipping_rate', method, index|default(0)) }}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
{# Shipping #}
|
||||
{{ do_action('woocommerce_cart_totals_before_shipping') }}
|
||||
|
||||
{% if wc_shipping_enabled() is defined and wc_shipping_enabled() %}
|
||||
{% if wc_shipping_enabled() %}
|
||||
<li class="list-group-item cart-shipping">
|
||||
{{ do_action('woocommerce_cart_totals_shipping') }}
|
||||
</li>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<section class="cross-sells mt-5">
|
||||
{% set heading = heading|default(__('You may be interested in…')) %}
|
||||
{% if heading %}
|
||||
<h2 class="h4 mb-4">{{ heading }}</h2>
|
||||
<h2 class="h4 mb-4">{{ heading|raw }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{{ woocommerce_product_loop_start() }}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<li class="woocommerce-mini-cart-item d-flex gap-3 py-2 border-bottom {{ item.css_class|default('') }}">
|
||||
{# Remove link #}
|
||||
<a href="{{ item.remove_url|esc_url }}"
|
||||
class="remove remove_from_cart_button text-danger"
|
||||
class="btn btn-sm btn-outline-danger remove remove_from_cart_button"
|
||||
aria-label="{{ __('Remove this item') }}"
|
||||
data-product_id="{{ item.product_id }}"
|
||||
data-cart_item_key="{{ item.key }}">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
{% if is_user_logged_in() is defined and not is_user_logged_in() %}
|
||||
{% if not is_user_logged_in() %}
|
||||
<div class="woocommerce-form-login-toggle mb-4">
|
||||
<div class="alert alert-info d-flex align-items-center" role="status">
|
||||
<i class="bi bi-person me-2" aria-hidden="true"></i>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
{{ do_action('woocommerce_review_order_before_shipping') }}
|
||||
|
||||
{% if wc_shipping_enabled() is defined and wc_shipping_enabled() %}
|
||||
{% if wc_shipping_enabled() %}
|
||||
{{ do_action('woocommerce_review_order_shipping') }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
{{ do_action('woocommerce_checkout_before_terms_and_conditions') }}
|
||||
|
||||
{% if wc_terms_and_conditions_checkbox_enabled() is defined and wc_terms_and_conditions_checkbox_enabled() %}
|
||||
{% if wc_terms_and_conditions_checkbox_enabled() %}
|
||||
<div class="woocommerce-terms-and-conditions-wrapper mb-3">
|
||||
{{ do_action('woocommerce_checkout_terms_and_conditions') }}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#}
|
||||
|
||||
{% if not is_user_logged_in() %}
|
||||
<form class="woocommerce-form woocommerce-form-login login{% if hidden %} d-none{% endif %}" method="post">
|
||||
<form class="woocommerce-form woocommerce-form-login login{% if hidden is defined and hidden %} d-none{% endif %}" method="post">
|
||||
|
||||
{{ do_action('woocommerce_login_form_start') }}
|
||||
|
||||
|
||||
@@ -63,5 +63,3 @@
|
||||
</div>
|
||||
|
||||
{{ do_action('woocommerce_account_dashboard') }}
|
||||
{{ do_action('woocommerce_before_my_account') }}
|
||||
{{ do_action('woocommerce_after_my_account') }}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
{% if order.get_customer_note() %}
|
||||
<tr>
|
||||
<th>{{ __('Note:') }}</th>
|
||||
<td class="text-end">{{ order.get_customer_note()|nl2br|esc_html }}</td>
|
||||
<td class="text-end">{{ order.get_customer_note()|esc_html|nl2br }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tfoot>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<input type="search"
|
||||
id="{{ field_id }}"
|
||||
class="form-control"
|
||||
placeholder="{{ __('Search products…') }}"
|
||||
placeholder="{{ __('Search products…') }}"
|
||||
value="{{ get_search_query() }}"
|
||||
name="s" />
|
||||
<button type="submit" class="btn btn-outline-primary" aria-label="{{ __('Search') }}">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{% endverbatim %}
|
||||
|
||||
<script type="text/template" id="tmpl-unavailable-variation-template">
|
||||
<p class="alert alert-warning mb-0">
|
||||
<p class="alert alert-warning mb-0" role="alert">
|
||||
{{ __('Sorry, this product is unavailable. Please choose a different combination.') }}
|
||||
</p>
|
||||
</script>
|
||||
|
||||
@@ -16,9 +16,16 @@
|
||||
# @since 0.1.0
|
||||
#}
|
||||
|
||||
{% set gallery_classes = 'woocommerce-product-gallery' %}
|
||||
{% set cols = columns|default(4) %}
|
||||
{% set has_images = post_thumbnail_id is defined and post_thumbnail_id %}
|
||||
{% set gallery_classes = 'woocommerce-product-gallery woocommerce-product-gallery--columns-' ~ cols %}
|
||||
{% if has_images %}
|
||||
{% set gallery_classes = gallery_classes ~ ' woocommerce-product-gallery--with-images' %}
|
||||
{% else %}
|
||||
{% set gallery_classes = gallery_classes ~ ' woocommerce-product-gallery--without-images' %}
|
||||
{% endif %}
|
||||
|
||||
<div class="{{ gallery_classes }}" data-columns="{{ columns|default(4) }}">
|
||||
<div class="{{ gallery_classes }}" data-columns="{{ cols }}" style="opacity: 0; transition: opacity .25s ease-in-out;">
|
||||
<div class="woocommerce-product-gallery__wrapper">
|
||||
{# Main product image #}
|
||||
{% if main_image_html is defined and main_image_html %}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<section class="related products mt-5">
|
||||
{% set heading = heading|default(__('Related products')) %}
|
||||
{% if heading %}
|
||||
<h2 class="h4 mb-4">{{ heading|esc_html }}</h2>
|
||||
<h2 class="h4 mb-4">{{ heading|raw }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{{ woocommerce_product_loop_start() }}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<section class="up-sells upsells products mt-5">
|
||||
{% set heading = heading|default(__('You may also like…')) %}
|
||||
{% if heading %}
|
||||
<h2 class="h4 mb-4">{{ heading }}</h2>
|
||||
<h2 class="h4 mb-4">{{ heading|raw }}</h2>
|
||||
{% endif %}
|
||||
|
||||
{{ woocommerce_product_loop_start() }}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{% block notifications %}
|
||||
{% if notifications is defined and notifications|length > 0 %}
|
||||
{% for notification in notifications %}
|
||||
<div class="alert alert-{{ notification.type|default('info') }} alert-dismissible fade show" role="alert">
|
||||
<div class="alert alert-{{ notification.type|default('info')|esc_attr }} alert-dismissible fade show" role="alert">
|
||||
{{ notification.message|wp_kses_post }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('Close') }}"></button>
|
||||
</div>
|
||||
@@ -34,7 +34,7 @@
|
||||
{% if flash_messages is defined %}
|
||||
{% for type, messages in flash_messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-{{ type }} alert-dismissible fade show" role="alert">
|
||||
<div class="alert alert-{{ type|esc_attr }} alert-dismissible fade show" role="alert">
|
||||
{{ message|wp_kses_post }}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ __('Close') }}"></button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user