First of all, check this below collection and make sure that your reserved order should be unique. If your if condition will be true then, records ...
null; /** * @var \Magento\Framework\View\Result\PageFactory
If you want to get order id on checkout_onepage_controller_success_action then you have to call $observer->getEvent()->getOrderIds().
//Try with below code. $orderId = 1234; //put your order id. $order ...
... is not getting order entity id. Event.xml
In info template you can use $order = $this->getInfo()->getOrder(); to get Mage_Sales_Model_Order object. Then you can get current order id ...
Preconditions (*) Magento 2.3.2 & 2.4-develop, community edition
If you're specifically doing this on the checkout success page - in success.phtml - then the code to get the order increment ID is already ...
Get order id from the Increment id, Order id is the Primary key of the sales_order table.
Is the order correctly registered for guest customers ? Do you have any exceptions ? Maybe you can try this : $quote->setCustomerId(null) ...