Commit 67082f1d93 for woocommerce
commit 67082f1d93083072c532eefba061ad463895d61b
Author: Jim <jim.appelt@gmail.com>
Date: Fri Feb 20 00:32:57 2026 +0100
fix: selectWoo not initializing on layered nav dropdown widget (#63275)
* fix selectWoo not initializing on layered nav dropdown widget
* chore: add changelog entry for selectWoo layered nav fix
---------
Co-authored-by: Brandon Kraft <public@brandonkraft.com>
diff --git a/plugins/woocommerce/changelog/fix-selectwoo-layered-nav-dropdown b/plugins/woocommerce/changelog/fix-selectwoo-layered-nav-dropdown
new file mode 100644
index 0000000000..59e10aa849
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-selectwoo-layered-nav-dropdown
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix selectWoo not initializing on the layered nav dropdown widget when using the OR query type.
\ No newline at end of file
diff --git a/plugins/woocommerce/includes/widgets/class-wc-widget-layered-nav.php b/plugins/woocommerce/includes/widgets/class-wc-widget-layered-nav.php
index f9dbfc6e43..f742a48937 100644
--- a/plugins/woocommerce/includes/widgets/class-wc-widget-layered-nav.php
+++ b/plugins/woocommerce/includes/widgets/class-wc-widget-layered-nav.php
@@ -297,7 +297,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
echo '</form>';
$handle = 'wc-widget-dropdown-layered-nav-' . $taxonomy_filter_name;
- wp_register_script( $handle, '', array( 'jquery' ), WC_VERSION, array( 'in_footer' => true ) );
+ wp_register_script( $handle, '', array( 'jquery', 'selectWoo' ), WC_VERSION, array( 'in_footer' => true ) );
wp_enqueue_script( $handle );
wp_add_inline_script(
$handle,
@@ -306,13 +306,13 @@ class WC_Widget_Layered_Nav extends WC_Widget {
jQuery( '.dropdown_layered_nav_" . esc_js( $taxonomy_filter_name ) . "' ).on( 'change', function() {
var slug = jQuery( this ).val();
jQuery( ':input[name=\"filter_" . esc_js( $taxonomy_filter_name ) . "\"]' ).val( slug );
-
+
// Submit form on change if standard dropdown.
if ( ! jQuery( this ).attr( 'multiple' ) ) {
jQuery( this ).closest( 'form' ).trigger( 'submit' );
}
});
-
+
// Use Select2 enhancement if possible
if ( jQuery().selectWoo ) {
var wc_layered_nav_select = function() {