Read More
Read More
Menu Close

    Override/Extend routes in existing modules Magento 2

    We will learn how to override/extend routes in the existing module.
    We can add the before or after parameters in the module node of the routes.xml file.

    <config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
        <router id="standard">
            <route id="catalog">
                <module name="Webkul_CustomCatalog" before="Magento_Catalog" />

    According to these configurations, FrontController looks for the actions in the Webkul_CustomCatalog before searching in the Magento_Catalog module.
    In the same way, after parameters will work.

    So with this configuration of routes.xml, we can use the catalog route for the Webkul_CustomCatalog module as well.

    Hope it will help you. Thank You.

    Searching for an experienced
    Magento 2 Company ?
    Read More
    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top