close
Skip to content

fix: selectWoo not initializing on layered nav dropdown widget#63275

Merged
kraftbj merged 2 commits into
woocommerce:trunkfrom
JimmyAppelt:trunk
Feb 19, 2026
Merged

fix: selectWoo not initializing on layered nav dropdown widget#63275
kraftbj merged 2 commits into
woocommerce:trunkfrom
JimmyAppelt:trunk

Conversation

@JimmyAppelt
Copy link
Copy Markdown
Contributor

@JimmyAppelt JimmyAppelt commented Feb 12, 2026

Summary

Fixes the layered nav dropdown widget (WC_Widget_Layered_Nav) widget not applying Select2/selectWoo enhancement when using OR

Since #40686 (WooCommerce 8.3.0), frontend scripts are registered with array( 'strategy' => 'defer' ) by default. The dropdown widget inline scripts register their handles with only jquery as a dependency:

wp_register_script( $handle, '', array( 'jquery' ), WC_VERSION, array( 'in_footer' => true ) );

In https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/widgets/class-wc-widget-product-categories.php#L244 this is already added.

@github-actions github-actions Bot added plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution labels Feb 12, 2026
@woocommercebot woocommercebot requested review from a team and kraftbj and removed request for a team February 12, 2026 15:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

Testing Guidelines

Hi ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 12, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Added the SelectWoo dependency to the WooCommerce layered navigation dropdown widget script registration and added a changelog entry documenting the fix for SelectWoo initialization when using the OR query type.

Changes

Cohort / File(s) Summary
Widget script update
plugins/woocommerce/includes/widgets/class-wc-widget-layered-nav.php
Script registration for the layered nav dropdown now includes selectWoo alongside jquery; minor whitespace adjustments inside the inline initialization script.
Changelog
plugins/woocommerce/changelog/fix-selectwoo-layered-nav-dropdown
Added a patch-level changelog entry describing the fix for SelectWoo not initializing with the OR query type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: selectWoo not initializing on layered nav dropdown widget' clearly and concisely describes the main change: fixing selectWoo initialization on the layered nav dropdown widget. It directly matches the changeset content.
Description check ✅ Passed The description is directly related to the changeset, explaining the root cause of the selectWoo initialization issue, referencing the script dependency problem introduced in WooCommerce 8.3.0, and noting a similar fix in the product categories widget.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kraftbj kraftbj self-assigned this Feb 19, 2026
@kraftbj kraftbj added this to the 10.7.0 milestone Feb 19, 2026
@kraftbj kraftbj enabled auto-merge (squash) February 19, 2026 23:01
@kraftbj kraftbj merged commit 67082f1 into woocommerce:trunk Feb 19, 2026
83 of 85 checks passed
@webdados
Copy link
Copy Markdown
Contributor

Taking into consideration the very minimal change in the code base (literally just this dependency: https://github.com/woocommerce/woocommerce/pull/63275/changes#diff-9ef3168fc51f8172e2e2df63d7b86fcf7d02461406e25728e5930610bda8030dR300), would it be possible to change the milestone to 10.6.0?

samnajian pushed a commit that referenced this pull request Mar 11, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants