After upgrading from Magento 2.4.2 to 2.4.3 the message
The store will not work correctly in the case when cookies are disabled.
Is displayed on all pages.
After upgrading from Magento 2.4.2 to 2.4.3 the message
The store will not work correctly in the case when cookies are disabled.
Is displayed on all pages.
I just encountered the same issue when updated to Magento 2.4.3. As a solution, I have added a layout XML file, which removes the "cookie-status-check" block.
In app\design\frontend\{my_theme}\Magento_Theme\layout\default_head_blocks.xml
,
where {my_theme} is my custom theme or the theme which is used by the frontend.
I added the following xml, which tells to remove the above mentioned block.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="cookie-status-check" remove="true"/>
</body>
</page>
By the way, I am in developer mode. So, if the block is not removed when you add this code, please clear your caches and deploy the static files if needed.
Also, we are overriding the below file from "Magento_Theme" module.
vendor/magento/module-theme/view/frontend/layout/default_head_blocks.xml
.
Please note if the browser has actually disabled cookies then the warning message won't be shown.
Please refer the official issue is below: https://github.com/magento/devdocs/issues/9095
This issue is caused by a change in M2.4.3 and how it handles the cookie status message.
If you are using a custom theme add the following to Magento_Theme/web/css/source/_module.less
.cookie-status-message {
display: none;
}
Update: this issue is fixed in Magento 2.4.4
The store will not work correctly in the case when cookies are disabled. You need to create the file and add code. app/design/frontend/vendor_theme/theme_name/Magento_Theme/templates/js/cookie_status.phtml Add code below it working for me.
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<div id="cookie-status">
<?= $block->escapeHtml(__('The store will not work correctly in the case when cookies are disabled.')); ?>
</div>
<?php
$script = 'document.querySelector("#cookie-status").style.display = "none";';
?>
<?= /* @noEscape */ $secureRenderer->renderTag('script', ['type' => 'text/javascript'], $script, false); ?>
<script type="text/x-magento-init">
{
"*": {
"cookieStatus": {}
}
}
</script>
On Magento 2.4.3
The store will not work correctly in the case when cookies are disabled. fixes on Potro 2 theam
Store > Configuration > Porto - Settings Panel > Customization Settings > Custom Style 1 >
Add this code
.cookie-status-message {
display: none;
}
This is a M 2.4.3 upgrade specific issue. Try the following: (for porto)
Add app/design/frontend/Smartwave/porto/Magento_Theme/web/css/source/_module.less:
.cookie-status-message {
display: none;
}