[FIX] 10.0 on_product_price_changed event with new API #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While migrating the connector_magento_pricing module I had trouble getting notifications from the "on_product_price_changed" event.
I wrote tests for the event to make sure this wasn't the cause. While doing so I realized the old API fired the event as expected but the new one did not. In fact when the change is done on a product.template, the product.products are notified with the old API but the notification is done on the product.template with the new API.
I made a fix that corrected my problem and everything works now. I am not sure this is the right way to do it (the use of 'product' is redundant).
Also, I have no idea how to test with the new API so my test does not cover this case but only the old way.