0

I am trying to create order programmatically by extending Mage::app() into my external folder.

I can able to create an order successfully. But after creating an order my quote is not getting expired. Next order is also created with same quote_id.

To avoid this I tried below,

            $order->sendNewOrderEmail();

            $quote->setIsActive(0);
            $quote->save();

But this remove the whole record from sales_flat_quote table.

How can I start next order with new quote?

1 Answer 1

2

You can change in session like below.

Mage::getSingleton('checkout/session')->setQuoteId(null);

so now if you will try to create new order then it will not find quote id in session. so magento will create new quote for your next order.

Hope it helps.

0

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.