1

we have onestepcheckout extension installed with Braintree as Payment Gateway. Everything is working fine on sandbox mode of Braintree. When I switch to Braintree production mode and place order using Credit card , it is redirecting to empty shopping cart. I still receive order email and order is showing up all good in admin. While I was debugging for this issue I found when I switch Magento deploy mode to developer mode , it is working fine ,but when I switch deploy mode to production mode ,it is redirecting to empty shopping cart.

Any idea what could be the issue we are using Nexcess cloud as hosting

  • I was able to fix this issue , It seems like the success.phtml was missing on theme and there was a reference in layout xml for this file , once I put the success.phtml file in theme , it started working fine. – Pravin Oct 23 '19 at 6:00
0

Please try the following solution to solve this: add following code in vendor\magento\module-checkout\Controller\Onepage\Success.php after this line $session = $this->getOnepage()->getCheckout();

$om = \Magento\Framework\App\ObjectManager::getInstance();
    $orderCollectionFactory = $om->get('\Magento\Sales\Model\ResourceModel\Order\CollectionFactory');

    $collection = $orderCollectionFactory->create()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter("quote_id",$session->getLastSuccessQuoteId()); //Add condition if you wish

    $order = $collection->getData();
    $session->setLastOrderId($order[0]['entity_id']);
|improve this answer|||||

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.