QUALITY PATCH

MDVA-42969: Related product rule only works when the customer segment is set to all

Related product rule only works when the customer segment is set to all. Quality patch MDVA-42969 for magento/module-customer-segment applies to Magento Open Source and Adobe Commerce 2.4.1 to 2.4.2-p2.

Categories
Catalog/Product
Components
magento/module-customer-segment, magento/module-target-rule
Origin
adobe-commerce-support
Since QPT
1.1.13

Issue

Related product rule only works when the customer segment is set to all.

Steps to reproduce

1. Go to Stores > Configuration > Catalog > Rule-Based Product Relations and set Show Related Products = Rule-Based Only. 1. Go to Customers > Segments and create a new segment: Apply To = Visitors and Registered Customers. 1. Go to Marketing > Related Product Rules and create a new rule. Apply To = Related Products Customer Segments = All Products to Match = SKU = <select a SKU> Products to Display = SKU +is one of+ Constant Value (specify 1-3 products) 1. Open the matching product on the storefront and verify that the Products to Display are shown. 1. Modify the rule created in step three and set Customer Segments = Specific > Segment from step two. 1. Open the matching product on the storefront.

Adobe's page lists 2.4.1 - 2.4.2-p2 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.5.

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 MDVA-42969. On Cloud, add MDVA-42969 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-42969/ 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-customer-segment, magento/module-target-rule

magento/magento2-ee-base >=2.4.1 <2.4.3

Magento Open Source
—
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2, 2.4.1-p1, 2.4.1
Patch file
patches/commerce/MDVA-42969_2.4.2-p1.patch
  • vendor/magento/module-customer-segment/Model/Customer.php
  • vendor/magento/module-target-rule/Model/ResourceModel/Index.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.