You can get your order from checkout session .Then using order id you can get orders item details by load of sales models.
\Magento\Sales\Model\Order $order, \Magento\Checkout\Model\Session $ checkoutSession, .... ){ .... $this->_order = $order; ...
You can get the current quote id from session $session = Mage::getSingleton(' checkout/session'); $quote_id = $session->getQuoteId();.
Re: Magento 2.15 Get order ID in a custom controller in custom payment Gateway module. hi, you can get order id from checkout session.
$ order in your code is the last order ID...as the function name implies.
You have to inject the checkout model session to get the latest order information. protected $_checkoutSession; public function __construct(
The best way (and actually I believe this is the way magento uses) is to pass the order ID into session. To do that, use ...
magento 2 get order total; magento 2 get cart items from session; magento 2 ...
Using chcekout seesion \Magento\Checkout\Model\Session object, I have try to get order id but it does not work. In magento 1.x , we can easily ...
Magento 2 Get last order id. you can get recent order id by last_order_id entity from checkout session. GetLastOrderId() used for get latest order ...