1

In Commerce 1 i can select orders by a specific property as follows:

$criteria = craft()->elements->getCriteria('Commerce_Order');
$criteria['orderStatusId'] = 1;
return craft()->elements->getCriteria('Commerce_Order', $criteria);

How can i do this in Commerce 2?

1 Answer 1

1
use craft\commerce\elements\Product;

$products = Product::find()->orderStatus(1)->all();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.