What happened?
Description
Every time the cart is updated, Craft Commerce evaluates ALL shipping rules to determine which ones apply, and it fetches the category conditions for each rule individually causing n+1 queries and sluggish add to cart problem).
Steps to reproduce
- Add many shipping rules
- Check the queries executed by adding a item to the cart
Expected behavior
Smarter evualition, maybe not on add to cart, or filtering relevant rules by getting them in bulk
Actual behavior
Slow, +1second add to cart
Craft CMS version
5.8.23
Craft Commerce version
5.5.2
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions