You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
do not execute Craft::$app->getUsers()->ensureUserByEmail($email); in case the customer is going to be eager loaded (maybe pass a parameter to the order)
Craft CMS version
4.x
Craft Commerce version
4.x
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered:
This is true at the moment, you are correct, but with upcoming deprecation of setEmail this will no longer be the case. Please see the PR to follow along: #3201
What happened?
Description
OrderQuery::withCustomer
is pretty much useless sinceOrder::setEmail
already fetches the customerBecause of that I have a bunch of duplicated queries and I'm not sure how to get rid of it
Steps to reproduce
Order::find()->customerId(1)->withCustomer()->all()
Expected behavior
Solution to solve this:
Craft::$app->getUsers()->ensureUserByEmail($email);
in case the customer is going to be eager loaded (maybe pass a parameter to the order)Craft CMS version
4.x
Craft Commerce version
4.x
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
No response
The text was updated successfully, but these errors were encountered: