1

I have a Magento EE site with two store views, the default store and a mobile store. When creating orders in the admin I would like to skip the step that asks the user to select a store, e.g. all orders would be placed under the default store.

Mage_Adminhtml_Block_Sales_Order_Create_Form::getStoreSelectorDisplay():

     $storeId    = $this->getStoreId();
     $customerId = $this->getCustomerId();
     if (!is_null($customerId) && !$storeId) {
         return 'block';
     }
     return 'none';

It looks like if I add $this->setStoreId(1) in the constructor (or somewhere) then the store selector will never be displayed and the order will be created under the store of my choosing. My question is, is there a better way to do this?

2 Answers 2

2

If you change the action for the "Create order" button and add the store_id parameter it will skip the form.

Normally the button to create an order for a client links to: /index.php/admin/sales_order_create/index/customer_id/6/

This will show you the store selector, so if you change the action to: /index.php/admin/sales_order_create/index/customer_id/6/store_id/1/

This will select the specified store and brings you directly to the order form.

The same can be done on the "Create New Order" button in the Sales->Orders grid, if you add store_id there it only asks you to select the customer (or create a new customer)

1
  • Actually in my version the Create Order button links to 'sales_order_create/start/...', which resets the quote and does not pass along a store_id parameter.
    – nachito
    Apr 29, 2013 at 20:57
0

You can do that by overriding Magento\Sales\Block\Adminhtml\Order\Create\Store\Select and adding setStoreId instruction in the constructor like this:

protected function _construct() {
  parent::_construct();
  // Allowing passing commades in BO for website 1 solely
  $this->setStoreIds([1]);
  $this->setId('sc_store_select');
 }

Your Answer

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

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