0

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
  • @Nikul can you paste your solution if you have done ? Jul 15, 2019 at 10:28

1 Answer 1

0

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;
    }
}
3
  • please clarify I do not understand..
    – Nikul
    Jul 15, 2019 at 10:46
  • This is called Preference right? @Ansar Husain
    – Gem
    Mar 25, 2020 at 5:50
  • Yes @Gem right. Mar 25, 2020 at 6:06

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.