Commit c37fb9b58d6 for woocommerce
commit c37fb9b58d6f6ccf304a1fc11a72a331e770ab6e
Author: Taha Paksu <3295+tpaksu@users.noreply.github.com>
Date: Mon Mar 30 17:44:34 2026 +0300
Patch 442 (#63922)
* Apply changes 442
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
diff --git a/plugins/woocommerce/changelog/63922-patch-442-trunk b/plugins/woocommerce/changelog/63922-patch-442-trunk
new file mode 100644
index 00000000000..08587caf5e2
--- /dev/null
+++ b/plugins/woocommerce/changelog/63922-patch-442-trunk
@@ -0,0 +1,4 @@
+Significance: patch
+Type: tweak
+
+Remove unused code from the Product Collection cart-contents handler.
\ No newline at end of file
diff --git a/plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection/HandlerRegistry.php b/plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection/HandlerRegistry.php
index bd239974699..e0fa65318e1 100644
--- a/plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection/HandlerRegistry.php
+++ b/plugins/woocommerce/src/Blocks/BlockTypes/ProductCollection/HandlerRegistry.php
@@ -476,15 +476,7 @@ class HandlerRegistry {
$location = $collection_args['productCollectionLocation'] ?? array();
if ( $request ) {
- $user_id = $request->get_param( 'userId' ) ? absint( $request->get_param( 'userId' ) ) : null;
- $user_email = $request->get_param( 'userEmail' ) ? sanitize_email( $request->get_param( 'userEmail' ) ) : null;
- if ( $user_id || $user_email ) {
- $cart_ids = CartCheckoutUtils::get_cart_product_ids_for_user( $user_id, $user_email );
- if ( ! empty( $cart_ids ) ) {
- return $cart_ids;
- }
- }
- // In editor context (REST request), show sample products for preview when cart is empty.
+ // In editor context (REST request), show sample products for preview. Only emails to the customer show live data.
$recent_product_ids = wc_get_products(
array(
'status' => 'publish',