2

I've tried a lot but can't get current order id from totals.phtml under my adminhtml directory.

2 Answers 2

4
$orderId = $this->getRequest()->getParam('order_id');

Finally got answer.

1
  • worked for me, try to add explanation as well! +1 :) Jun 27, 2018 at 11:22
1

You can get current order Id by below code

echo $block->getOrder()->getId();

12
  • no it's not working
    – Ramesh KR
    Feb 8, 2018 at 11:25
  • no function name getOrder() in block file
    – Ramesh KR
    Feb 8, 2018 at 11:25
  • I have checked and it's worming. Feb 8, 2018 at 11:26
  • send me file path. Feb 8, 2018 at 11:26
  • Magento\Sales\Block\Adminhtml\Totals.php
    – Ramesh KR
    Feb 8, 2018 at 11:27

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.