QuestionQ46

VerifiedCustomers

An Adobe Commerce Architect must create a new customer-segment condition that lets administrators set an “Average sales amount” condition for selected segments.

The Architect creates the custom condition at Vendor\Module\Model\Segment\Condition\AverageSalesAmount, including all required implementation details:

Question Image

During testing, this error is displayed:

Question Image

Which two actions should the Architect take to resolve the issue?

Choose two
Explanation

Magento\CustomerSegment\Model\ConditionFactory::create() only permits and directly instantiates class names that already contain the Magento\CustomerSegment\Model\Segment\Condition\ namespace prefix; if the prefix substring is missing from the supplied class string it is prepended, so a custom condition living in a vendor namespace must be exposed via a di.xml virtualType named with the expected Magento-prefixed alias (pointing to the real vendor class), and the condition's registered 'value' must be set to that same Magento-prefixed alias string so the factory recognizes the prefix and resolves the virtualType instead of double-concatenating the namespace.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!