1

I have the below observer event in my REST API .

        Mage::dispatchEvent('salesrule_validator_process', array(
            'rule'    => $rule,
            'item'    => $item,
            'address' => $address,
            'quote'   => $quote,
            'qty'     => $qty,
            'result'  => $result,
        ));

But this event handler is not triggering while I executing through REST API in our module.

Please let me know how to call this observer in API. what are the configuration to be made in config.xml

Awaiting for your response.

1 Answer 1

1

you need to add this in the config.xml under the global tag

<events>
    <salesrule_validator_process>
        <observers>
            <[some_unique_name_here]>
                <type>singleton</type>
                <class>[class_name_or_alias_here]</class>
                <method>methodToCall</method>
            </[some_unique_name_here]>
        </observers>
    </salesrule_validator_process>
</events>

clear the cache and you are done.

1
  • Hi Marius, thanks for information. I have the REST API for add the product into cart. And extended Salesrule module into local directory. I have added the above observer event code in addtocart module and salesrule module but still the event is not triggered . can you tell me what is the issue
    – Mohamed
    Commented Feb 1, 2016 at 14:48

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.