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.
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.
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.
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">