TransWikia.com

Event "controller_action_predispatch" not working. Magento 1

Magento Asked by Hamendra Sunthwal on January 4, 2021

Config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>0.1.0</version>
        </Vendor_Module>
    </modules>
    <global>
        <models>
            <vendor_vodule>
                <class>vendor_vodule_Model</class>
            </vendor_vodule>
        </models>
        <helpers>
            <vendor_vodule>
                <class>vendor_vodule_Helper</class>
            </vendor_vodule>
        </helpers>
    </global>
    <frontend>
        <events>
            <controller_action_predispatch>
                <observers>
                    <vendor_vodule>
                        <class>Vendor_Module_Model_Observer</class>
                        <method>Module</method>
                    </vendor_vodule>
                </observers>
            </controller_action_predispatch>
        </events>
    </frontend>
    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <vendor_vodule translate="title" module="vendor_vodule">
                                            <title>Module Validation</title>
                                            <sort_order>999</sort_order>
                                        </vendor_vodule>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config> 

Vendor/Module/Model/Observer.php

<?php

class Vendor_Module_Model_Observer
{
    /**
     * Validate
     *
     * @param Varien_Object $eventObject
     */
    public function Module($eventObject)
    {
        echo 'check'; exit;
    }
}

Any thoughts what’s the issue with event ?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP