I'm working on a quote system where I want the admin to be able to activate it, which will then forward them to the create new order page in Adminhtml, sales_order_create
.
I want this page to already have a customer assigned & products selected.
Edit:
I'd like to be able to pre-populate the quote for the Adminhtml page for creating an order.
Here's an example of creating a cart quote on the front-end:
$cart = Mage::getModel('checkout/cart');
$product = Mage::getModel('catalog/product')->load($productId);
if ($product){
if ($product->isSaleable()){
$cart->addProduct($product, array('qty' => $qty));
}
}
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
$cart->save();
I want to do this, but in the backend (sales_order_place
)
I'm looking at the code in app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
and it looks like adminhtml/session_quote
would be the model I'd be aiming to use.
So the workflow would be:
- Set up quote object
- Call
$this->redirect('*/sales_order_create');
- The admin will then be redirected to the create new order page with a customer already selected and the basket already populated with products
Would really appreciate some input.