New answers tagged


@Brad Bell, Craft commerce version is 2.2.19


In Commerce, a User (or guest with an email address for that matter) can have multiple carts (or unfinished orders). So we need to get the most recently active one. Something like this should work: $query = Order::find(); $query->id($whateverId); // you could also use $query->email $query->isCompleted(false); $query->orderBy('dateCreated DESC'); ...

Top 50 recent answers are included