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' ));
  } 
2
  • 1
    add your code too in question Commented May 10, 2016 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' ));} Commented May 10, 2016 at 7:19

1 Answer 1

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()
10
  • my query string is like $url = "exportleftovers.co/leopardmagento/…"; Commented May 10, 2016 at 7:20
  • then use $_REQUEST["order_id"]; Commented May 10, 2016 at 7:34
  • no no i need the order id in current page of module file like Observer.php Commented May 10, 2016 at 7:36
  • check answer updated Commented May 10, 2016 at 7:41
  • how can i write the code to get the order id? can you please let me know? Commented May 10, 2016 at 9:01

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.