Skip to content

Conversation

@oshmyheliuk
Copy link
Contributor

Purpose of this pull request

This pull request (PR) adds information about new functionality, such as original data in the event payload and a new onChange operator based on original data.

Affected pages

Links to Magento Open Source code

  • ...

</config>
```

## Trigger events on specific field changes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add an example when the events need to be triggered once qty or price is being changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that we don't have OR rules, all rules are processed as AND.
By adding the next rules:

          <rule>
               <field>quantity_and_stock_status.qty</field>
               <operator>onChange</operator>
               <value />
           </rule>
          <rule>
               <field>price</field>
               <operator>onChange</operator>
               <value />
           </rule>

The event will be triggered only if both price and quantity are changed.

Currently, it's possible to resolve by creating a separate subscription with an Alias name, one for price change and one for quantity change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should we state somewhere that OR rules aren't supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the next definition at the beginning of that page.

If one or more rules evaluate as false, the service sends neither the parent event nor the conditional event, unless the parent has been subscribed separately, without any rules.

Should we mention it one more time?

</config>
```

## Trigger events on specific field changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should we state somewhere that OR rules aren't supported.

@github-project-automation github-project-automation bot moved this from 📋 Needs Review to 🛠 Changes Requested in Commerce - Pull Requests Oct 29, 2025
@github-project-automation github-project-automation bot moved this from 🛠 Changes Requested to 👍 Approved in Commerce - Pull Requests Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👍 Approved

Development

Successfully merging this pull request may close these issues.

3 participants