Skip to content

Conversation

@woocommercebot
Copy link
Collaborator

This PR is a cherry-pick of #62472 to release/10.4.

⚠️ WARNING: This cherry-pick contained conflicts that have not been resolved. Please review the changes carefully before merging!

Original PR Description

Submission Review Guidelines:

Changes proposed in this Pull Request:

After updating to WooCommerce 10.4.2, the "Undo" button for cart item removal didn't work anymore.

The clean_up_removed_cart_contents() method cleared removed_cart_contents on template_redirect hook, but it ran on the same request that displays the undo link, not on the next user-initiated request.

This PR adds a check for the removed_item=1 query parameter, which is set when redirecting after item removal.

Closes #62456.
Closes https://linear.app/a8c/issue/WOOPLUG-6006/undo-item-deletion-from-cart-does-not-work-after-update-to-1042
(For Bug Fixes) Bug introduced in PR #61223

How to test the changes in this Pull Request:

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

  1. Add items to cart
  2. Go to cart shortcode
  3. Remove an item - verify "Undo?" link appears
  4. Click "Undo" - verify item is restored to cart
  5. Remove item again, navigate away, then come back - verify undo no longer visible

Testing that has already taken place:

I also tested with Products bundle to make sure the was no regression

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

@woocommercebot woocommercebot requested a review from a team as a code owner December 18, 2025 20:05
@woocommercebot woocommercebot requested review from opr and ralucaStan and removed request for a team December 18, 2025 20:05
@github-actions github-actions bot added this to the 10.4.0 milestone Dec 18, 2025
@github-actions github-actions bot added focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Dec 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

Testing Guidelines

Hi @kraftbj @opr ,

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.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Backwards Compatibility Review - Found 1 potential issue

Generated by Claude via this workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

@ralucaStan ralucaStan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the PHPStan baseline conflict.
I tested again and worked as expected

@ralucaStan ralucaStan requested a review from kraftbj December 19, 2025 08:35
@kraftbj kraftbj merged commit 5a9085f into release/10.4 Dec 19, 2025
69 checks passed
@kraftbj kraftbj deleted the cherry-pick-PR62472-to-release/10.4 branch December 19, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. Release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants