Domanda

Ho usato sotto il codice per salvare Contattaci Pagina dati. Ma non funziona.

<events>
<controller_action_postdispatch_contacts_index_post>
<observers>
    <freedom_customercontact_controller_action_postdispatch_contacts_index_post>
        <class>freedom_customercontact/observer</class>
        <method>controllerActionPostdispatchContactsIndexPost</method>
    </freedom_customercontact_controller_action_postdispatch_contacts_index_post>
</observers>
.

.

Codice dell'osservatore

 <?php

class Freedom_Customercontact_Model_Observer
{
    public function controllerActionPostdispatchContactsIndexPost()
    {
        exit('Hi');
        $data = $observer->getData();
    $post = $data['controller_action']->getRequest()->getPost();
    }
}
.

Qualcuno può dirmi perché questo non funziona per favore.

È stato utile?

Soluzione

OK Ho trovato Evento Soluzione è in tag front-end Non in Global

<frontend>
    <events>
        <controller_action_postdispatch_contacts_index_post>
            <observers>
                <freedom_customercontact_controller_action_postdispatch_contacts_index_post>
                    <type>model</type>
                    <class>customercontact/observer</class>
                    <method>controllerActionPostdispatchContactsIndexPost</method>
                </freedom_customercontact_controller_action_postdispatch_contacts_index_post>
            </observers>
        </controller_action_postdispatch_contacts_index_post>
    </events>
</frontend>
.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top