QUALITY PATCH

ACSD-54887: Customer shopping cart gets cleared after the customer session has expired…

Customer shopping cart gets cleared after the customer session has expired with Persistent Shopping Cart enabled. Quality patch ACSD-54887 for magento/module-persistent applies to Magento Open Source and Adobe Commerce 2.4.4-p4 to 2.4.6-p5.

Categories
Order/Checkout
Components
magento/module-persistent, magento/module-quote
Origin
adobe-commerce-support
Since QPT
1.1.50

Issue

Customer shopping cart gets cleared after the customer session has expired with Persistent Shopping Cart enabled.

Steps to reproduce

1. Enable Persistent Shopping Cart. Go to Stores > Configuration > Customers > Persistent Shopping Cart = Yes. Log in with Persistence enabled (Note: It is not available on the popup authorization, but only on the direct Sign in page). 1. Add a product to the cart. 1. Proceed to checkout and select a payment method. 1. Expire the session (delete PHPSESSID). 1. Refresh the page. Observe that the quote is immediately converted to a guest quote because a payment method is already selected, and the Persistent Cart cookie is removed. 1. Expire the session (delete PHPSESSID). 1. Refresh the page. See that the cart is empty. 1. Sign in again.

Adobe's page lists 2.4.4 - 2.4.4-p8, 2.4.5-p3 - 2.4.5-p7, and 2.4.6-p1 - 2.4.6-p5 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Adobe scheduled the permanent fix for 2.4.8.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-54887. On Cloud, add ACSD-54887 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-54887/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (2): magento/module-persistent, magento/module-quote
Packages across compatible versions (2): magento/module-persistent, magento/module-quote

magento/magento2-base >=2.4.4-p4 <2.4.4-p9 || >=2.4.5-p3 <2.4.5-p8 || >=2.4.6-p1 <2.4.6-p6

Magento Open Source
2.4.6-p5, 2.4.6-p4, 2.4.6-p3, 2.4.6-p2, 2.4.6-p1, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.4-p8, 2.4.4-p7, 2.4.4-p6, 2.4.4-p5, 2.4.4-p4
Adobe Commerce
2.4.6-p5, 2.4.6-p4, 2.4.6-p3, 2.4.6-p2, 2.4.6-p1, 2.4.5-p7, 2.4.5-p6, 2.4.5-p5, 2.4.5-p4, 2.4.5-p3, 2.4.4-p8, 2.4.4-p7, 2.4.4-p6, 2.4.4-p5, 2.4.4-p4
Patch file
patches/os/ACSD-54887_2.4.6-p2.patch
  • vendor/magento/module-persistent/Model/Checkout/GuestPaymentInformationManagementPlugin.php
  • vendor/magento/module-persistent/Model/Checkout/GuestShippingInformationManagementPlugin.php
  • vendor/magento/module-persistent/Model/Plugin/ConvertCustomerCartToGuest.php (added)
  • vendor/magento/module-persistent/Model/QuoteManager.php
  • vendor/magento/module-persistent/etc/di.xml
  • vendor/magento/module-persistent/etc/webapi_rest/di.xml
  • vendor/magento/module-persistent/etc/webapi_soap/di.xml
  • vendor/magento/module-quote/Model/Quote/Address/BillingAddressPersister.php
  • vendor/magento/module-quote/Model/QuoteAddressValidator.php
  • vendor/magento/module-quote/Model/ShippingAddressManagement.php

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.