What happened?
Description
When changing the sorting of the variants, this is triggering a Catalog Pricing Job for every variant of the product, while the sorting is only getting applied after saving the product itself, which in his turn is creating 1 Catalog Job for every variant.
Those first jobs on changing the sorting seems unnecessary as on that moment the sorting isn't actually applied yet on the live product.
Our products are mapped to elasticsearch for filtering and searching on the front-end so we are checking the EVENT_AFTER_EXEC event to push changes to elasticsearch, but this is creating a bunch of unnecessary load, especially when you have products with 100+ variants.
Steps to reproduce
- have a product with multiple variants
- Change the sorting of the variants
- For every variant a catalog pricing job is created
- After saving the product 1 catalog pricing job is created that contains all the variants
Expected behavior
Changing order doesn't trigger a catalog pricing job
Craft CMS version
5.9.17
Craft Commerce version
5.6.1
PHP version
8.3
Operating system and version
No response
Database type and version
mysql 8.0
Image driver and version
No response
Installed plugins and versions
What happened?
Description
When changing the sorting of the variants, this is triggering a Catalog Pricing Job for every variant of the product, while the sorting is only getting applied after saving the product itself, which in his turn is creating 1 Catalog Job for every variant.
Those first jobs on changing the sorting seems unnecessary as on that moment the sorting isn't actually applied yet on the live product.
Our products are mapped to elasticsearch for filtering and searching on the front-end so we are checking the
EVENT_AFTER_EXECevent to push changes to elasticsearch, but this is creating a bunch of unnecessary load, especially when you have products with 100+ variants.Steps to reproduce
Expected behavior
Changing order doesn't trigger a catalog pricing job
Craft CMS version
5.9.17
Craft Commerce version
5.6.1
PHP version
8.3
Operating system and version
No response
Database type and version
mysql 8.0
Image driver and version
No response
Installed plugins and versions