Magento 2 – How to Continue Showing Loader on Checkout

magento-2.1magento2

When the customer clicks on the submit button on the last page of the checkout in Magento 2, the screen grays out and the loader starts. Before finishing the request, the screen goes back to normal and magento hides the loader. Many times, the customer thinks that the order has been processed, but the request still requires another 2-3 seconds before it's fully executed.

I want to know how I can keep the loader active until the request is fully executed.

Best Answer

I found a solution.

Open vendor/magento/module-checkout/view/frontend/web/js/action/set-payment-information.js and find:

return storage.post(
    serviceUrl, JSON.stringify(payload)
).fail(
    function (response) {
        errorProcessor.process(response, messageContainer);
    }
).always(
    function () {
        fullScreenLoader.stopLoader(); // you need remove this
    }
);

For replace code you can create "preference" for this file in your theme in requirejs-config.js.