0

First i make the custom module to add custom button in Order View page and its successfully added. Now i want to get the Current Order ID at my Custom Module Page. Please guide me how can i get the Current Order ID.

Basically i want to take the current order id by using query string to my next page.

Please let me know how can i get the order id at my next page?

code

addbuttoninorder($event) { 
     Mage::log("adadadasd"); 
     $block = $event->getBlock(); 
     $url = "exportleftovers.co/leopardmagento/…;; 
    if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {
    $block->addButton('change_status', array( 
      'label' => Mage::helper('sales')->__('Leopard TN New'),      
      // 'onclick' => "confirmSetLocation('{$message}','{$block->getUrl('modulename/path/')}')", 
      'onclick' => "window.open('".$url."')", 'class' => 'go' ));
  } 
  • 1
    add your code too in question – Qaisar Satti May 10 '16 at 6:17
  • public function addbuttoninorder($event) { Mage::log("adadadasd"); $block = $event->getBlock(); $url = "exportleftovers.co/leopardmagento/…"; if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) { $block->addButton('change_status', array( 'label' => Mage::helper('sales')->__('Leopard TN New'), // 'onclick' => "confirmSetLocation('{$message}', '{$block->getUrl('modulename/path/')}')", 'onclick' => "window.open('".$url."')", 'class' => 'go' ));} – Muneeb Ahmad May 10 '16 at 7:19
0

if you have query string like : www.DOMAIN.com/MODULENAME/CONTROLLER/ACTION/order_id/52

then you can get order_id from query srting by $this->getRequest()->getParam("order_id");

Update: For Observer.php, you can use

Mage::app()->getFrontController()->getRequest()->getParams();

or

Mage::app()->getRequest()->getParams()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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