I can see that "order.submit()" is called from create order button but i am not sure where is the logic is located.

Issue is order does not created on first click on create order button due to that ia m trying to debug the issue.

Any thoughts where i can find the responsible file in magento 1 ?

1 Answer 1


For Frontend: If you see checkout/onepage/reviews/info.phtml file you may find a code like this.

<script type="text/javascript">
    review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));

You can see the URL route checkout/onepage/saveOrder which is triggered on order submit. The action path for this route will be saveOrderAction() in file app/code/core/Mage/Checkout/controllers/OnepageController.php.

For Admin Side:

The sales order create view comes app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php. Where you could find the line

$this->_updateButton('save', 'onclick', "order.submit()");

You can see the order.submit() is called when you click save button. The order object is created in app/design/adminhtml/default/default/template/sales/order/create/form.phtml see code below

var order = new AdminOrder(<?php echo $this->getOrderDataJson() ?>);

The AdminOrder class comes from js/mage/adminhtml/sales.js, you may find the submit() in this file which calls editform.submit().

The Edit form is available in same form.phtml with action url of controller save action.

<form id="edit_form" action="<?php echo $this->getSaveUrl() ?>" method="post" enctype="multipart/form-data">

The definition of $this->getSaveUrl() is available at app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php

public function getSaveUrl()
   return $this->getUrl('*/*/save');

The Controller action is saveAction() from app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php

Hope it was helpful for you to get the flow. Thanks

  • For backend ??? Aug 31, 2020 at 10:51
  • Actually i am checking for magento backend. Aug 31, 2020 at 10:52
  • Please see the updated answer. Aug 31, 2020 at 11:04
  • I still do not get idea about from where the save action is called ? when submit button is clicked from backend Aug 31, 2020 at 11:36
  • Please see the updated answer. And please do upvote if it helped you. :) Aug 31, 2020 at 12:14

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.