Skip to content

Remove woocommerce.js script enqueueing for block themes #60246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

dinhtungdu
Copy link
Member

Submission Review Guidelines:

Changes proposed in this Pull Request:

The woocommerce.js file provides multiple functionalities for classic themes (listed below). But for block themes, the functionalities of that file are covered by blocks. This PR removes the equeueing of that script for block themes, which also reduces jQuery and jQuery cookie from the loaded scripts.

Extensions rely on the script and declare it as the dependency should see nothing change. But there is a great chance that many won't declare dependency for woocommerce.js, this PR will probably break those extensions when used with a block theme.

woocommerce.js:

  • Product ordering: Auto-submits forms when users change the "sort by" dropdown
  • Quantity input validation: Ensures quantity inputs meet minimum requirements
  • Store notice management: Shows/hides dismissible store notices using cookies
  • Password visibility toggle: Adds show/hide buttons for password fields
  • Form field descriptions: Interactive help text that appears on focus
  • Accessibility enhancements:
    • Keyboard navigation for button-role links (spacebar/enter)
    • Screen reader announcements for notices and sorted results
    • Focus management for live regions
  • Coming soon banner: Dismissal functionality with AJAX persistence

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Smoke test store with both classic and block themes, see no regression.
  2. Test with extensions:

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Aug 7, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant