Skip to content

Fix persistent cart guest access after APSB26-73 - #41257

Draft
srdyilmaz197-a11y wants to merge 2 commits into
magento:2.4-developfrom
srdyilmaz197-a11y:fix/41090-persistent-cart-checkout
Draft

Fix persistent cart guest access after APSB26-73#41257
srdyilmaz197-a11y wants to merge 2 commits into
magento:2.4-developfrom
srdyilmaz197-a11y:fix/41090-persistent-cart-checkout

Conversation

@srdyilmaz197-a11y

Copy link
Copy Markdown

Description (*)

APSB26-73 added guest-cart ownership validation that rejects a masked cart while its quote still has a customer ID. Magento_Persistent intentionally creates that state for remembered shoppers whose normal customer session has expired: the quote remains customer-owned while checkout is routed through guest-cart APIs.

This change converts only the active persistent customer's own quote at the shared masked-cart ID resolution boundary, before guest-cart services apply the new check. The conversion requires the persistent-session customer ID to match the quote owner ID, so a masked ID for another customer's quote remains rejected.

The conversion also marks the quote as guest, clears the emulated customer session, and removes the persistent cookie/session after the ownership match.

The plugin is registered for frontend, REST, and SOAP because Magento_Persistent participates in those guest checkout paths.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes APSB26-73 guest cart check rejects persistent carts, breaking checkout when Magento_Persistent is enabled #41090

Manual testing scenarios (*)

  1. Enable Persistent Shopping Cart, including Persist Shopping Cart, with Clear Persistence on Sign Out disabled.
  2. Log in as a registered customer with Remember Me enabled and add a product to the cart.
  3. Expire/delete only the normal PHP session cookie while keeping persistent_shopping_cart.
  4. Reload checkout and confirm the remembered cart is restored while the shopper is not normally logged in.
  5. Continue through guest-cart shipping/totals/payment requests using the masked cart ID.
  6. Verify the persistent shopper's own quote is converted to a guest quote before guest-cart ownership validation and checkout can proceed.
  7. As a negative case, use a persistent session whose customer ID does not match the masked quote owner and verify the quote is not converted.

Questions or comments

Unit and integration regression coverage is included. A full Magento/PHP test run was not available in the local laptop environment, so this is being opened as a draft for repository CI/maintainer validation.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant

m2-assistant Bot commented Sep 13, 2026

Copy link
Copy Markdown

Hi @srdyilmaz197-a11y. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APSB26-73 guest cart check rejects persistent carts, breaking checkout when Magento_Persistent is enabled

1 participant