How can this be done in PHP? I can't find anything in the docs.


To add orders programmatically, you can do so by using the Commerce_OrderModel class.

Like so:

$order = new Commerce_OrderModel();
$order->email = 'test@example.com';

// Add your products here and other order info...
// .................

$success = craft()->commerce_orders->saveOrder($order);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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