Closed Gs-Joel closed 1 year ago
Using customer()
as an element query is still possible (although just fixed some minor typing), but instead of a Commerce customer, it's just a Craft user. I've updated the docs to reflect this.
You'll want to adjust that to:
$purchasedTickets = PurchasedTicket::find()->customer($user);
To get the fix early, change your verbb/events
requirement in composer.json
to:
"require": {
"verbb/events": "dev-craft-4 as 2.0.0-beta.8",
"...": "..."
}
Then run composer update
.
Thanks so much for the update. That query is now working on my end with the User object.
Question
I have a similar question to #71.
I'm in the middle of upgrading a site to Craft 4 and the site uses the Element API plugin to serve some data.
We were using
but the function
getCustomerByUserId()
was removed in Craft Commerce 4 as Customers were made into Users. However when trying to pass User data I get the following error.The FE templating documentation hasn't been updated between v1 and v2 so I wanted to check that this was even still possible in Craft 4.
thanks in advance
Additional context
No response