Skip to main content
added 4 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

I have installed a blog module onto my Magento 2 platform. This blog module has an observer which automatically adds a new menu item into the primary navigation. I wish to stop this.

The events.xmlevents.xml file looks like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="page_block_html_topmenu_gethtml_before">
        <observer name="aw_blog_add_topmenu_items" instance="Aheadworks\Blog\Observer\AddBlogToTopmenuItemsObserver" />
    </event>
</config>

As you can see it references the observer that adds the link into the primary navigation. Deleting events.xmlevents.xml solves my problem, but I'm looking for a method that doesn't involve modifying of core module files.

I have installed a blog module onto my Magento 2 platform. This blog module has an observer which automatically adds a new menu item into the primary navigation. I wish to stop this.

The events.xml file looks like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="page_block_html_topmenu_gethtml_before">
        <observer name="aw_blog_add_topmenu_items" instance="Aheadworks\Blog\Observer\AddBlogToTopmenuItemsObserver" />
    </event>
</config>

As you can see it references the observer that adds the link into the primary navigation. Deleting events.xml solves my problem, but I'm looking for a method that doesn't involve modifying of core module files.

I have installed a blog module onto my Magento 2 platform. This blog module has an observer which automatically adds a new menu item into the primary navigation. I wish to stop this.

The events.xml file looks like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="page_block_html_topmenu_gethtml_before">
        <observer name="aw_blog_add_topmenu_items" instance="Aheadworks\Blog\Observer\AddBlogToTopmenuItemsObserver" />
    </event>
</config>

As you can see it references the observer that adds the link into the primary navigation. Deleting events.xml solves my problem, but I'm looking for a method that doesn't involve modifying of core module files.

Tweeted twitter.com/StackMagento/status/723582657263706116
Source Link
Angus
  • 121
  • 3

Remove observer from third party extension

I have installed a blog module onto my Magento 2 platform. This blog module has an observer which automatically adds a new menu item into the primary navigation. I wish to stop this.

The events.xml file looks like this:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="page_block_html_topmenu_gethtml_before">
        <observer name="aw_blog_add_topmenu_items" instance="Aheadworks\Blog\Observer\AddBlogToTopmenuItemsObserver" />
    </event>
</config>

As you can see it references the observer that adds the link into the primary navigation. Deleting events.xml solves my problem, but I'm looking for a method that doesn't involve modifying of core module files.