-3

I want to remove the default page loader when the page is loading. I have to remove checkout loader from

/vendor/magento/module-checkout/view/frontend/templates/onepage.phtml

But still, loader coming.

3
  • Did you checked this file ? vendor/magento/module-captcha/view/frontend/templates/default.phtml Commented Nov 11, 2019 at 12:56
  • 1
    yes but captcha is disable at the moment Commented Nov 11, 2019 at 12:57
  • check file module-ui\view\base\web\js\block-loader.js Commented Nov 14, 2019 at 6:37

2 Answers 2

0

Open /vendor/magento/module-checkout/view/frontend/templates/onepage.phtml file and comment loader code.

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/** @var $block \Magento\Checkout\Block\Onepage */
?>
<div id="checkout" data-bind="scope:'checkout'" class="checkout-container">
    <!-- <div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>
        <div class="loader">
            <img src="<?= $block->escapeUrl($block->getViewFileUrl('images/loader-1.gif')) ?>"
                 alt="<?= $block->escapeHtmlAttr(__('Loading...')) ?>"
                 style="position: absolute;">
        </div>
    </div> -->
    <!-- ko template: getTemplate() --><!-- /ko -->
    <script type="text/x-magento-init">
        {
            "#checkout": {
                "Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
            }
        }
    </script>
    <script>
        window.checkoutConfig = <?= /* @noEscape */ $block->getSerializedCheckoutConfig() ?>;
        // Create aliases for customer.js model from customer module
        window.isCustomerLoggedIn = window.checkoutConfig.isCustomerLoggedIn;
        window.customerData = window.checkoutConfig.customerData;
    </script>
    <script>
        require([
            'mage/url',
            'Magento_Ui/js/block-loader'
        ], function(url, blockLoader) {
            blockLoader("<?= $block->escapeJs($block->escapeUrl($block->getViewFileUrl('images/loader-1.gif'))) ?>");
            return url.setBaseUrl('<?= $block->escapeJs($block->escapeUrl($block->getBaseUrl())) ?>');
        })
    </script>
</div>

Clear cache: php bin/magento cache:clean. And check it.

3
  • why you people don't read question carefully. I have written in bold that i have already remove loader from onepage.phtml Commented Nov 12, 2019 at 7:38
  • Clear cache and check it. Commented Nov 12, 2019 at 8:34
  • Any why you vote down????? Commented Nov 12, 2019 at 8:34
-1

overwrite of onepage.phtml in one of your themes or modules.

<div id="checkout-loader" data-role="checkout-loader" class="loading-mask" data-mage-init='{"checkoutLoader": {}}'>

change to :

<div id="checkout-loader" data-role="checkout-loader" class="loading-mask">
2
  • please read question carefully Commented Nov 12, 2019 at 4:58
  • Your question is unclear to what's your issue
    – Manoj Pal
    Commented Nov 14, 2019 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.