How to remove/disable demo store notice from admin side. We want to remove from only admin side but we want that show in front. Our site is in magento 2.2.5 Any one help me for solve this issue.
1 Answer
Just override block Magento\Backend\Block\Page\Notices for disable demo store notification only for admin section.
Create Vendor\Module\etc\di.xml file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Backend\Block\Page\Notices" type="Vendor\Module\Block\Adminhtml\Page\Notices"/>
</config>
Create Vendor\Module\Block\Adminhtml\Page\Notices.php file
<?php
namespace Vendor\Module\Block\Adminhtml\Page;
class Notices extends \Magento\Backend\Block\Page\Notices
{
/**
* Check if demo store notice should be displayed
*
* @return boolean
*/
public function displayDemoNotice()
{
/*return $this->_scopeConfig->getValue(
'design/head/demonotice',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);*/
return false;
}
}