getOnepage()->getCheckout()->getLastQuoteId(); $lastOrderId = $this->getOnepage()->getCheckout()->getLastOrderId(); if (!$lastQuoteId || !$lastOrderId) { return $this->resultRedirectFactory->create()->setPath('checkout/cart'); } return $this->resultPageFactory->create(); } }