What would be the steps involved in converting a quote object in magento to an order.
Say i have the following:
$quote = Mage::getModel('sales/quote')->load(100);
There is no order yet and this quote object is still active.
How do I go from here to completing that quote and making an order from it.
I have tried:
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
This creates an order but doesnt complete the quote. Also, the order is in a pending status and not processing i.e. it has not been invoiced.
Have you tried the Mage_Sales_Model_Convert_Quote
- toOrder
method?
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order=null)
Example:
$quote = Mage::getModel('sales/quote')->load(100);
$order = Mage::getSingleton('sales/convert_quote')->toOrder($quote);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With