Try the Demo

Magento Forum

   
Not firing checkout_cart_product_add_before event
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

Im trying to add an observer to the checkout_cart_product_add_before event.
but it it not working…
does anybody can see what i am doing wrong?

here is my config.xml:

<frontend>
        <
events>
            <
checkout_cart_product_add_before>  
                <
observers>  
                    <
check_product_type>  
                        <
type>singleton</type>  
                        <class>
Pricerulesextended/Observer</class>    
                        <
method>checkProductType</method>            
                    </
check_product_type>
                </
observers>
            </
checkout_cart_product_add_before>  
        </
events>
        <
routers>
            <
Dg_Pricerulesextended>
                <use>
standard</use>
                <
args>
                    <
module>Dg_Pricerulesextended</module>
                    <
frontName>giftvoucher</frontName>
                </
args>
            </
Dg_Pricerulesextended>
        </
routers>
    </
frontend>

here is my Observer:

class Dg_Pricerulesextended_Model_Observer {
public function checkProductType(Varien_Event_Observer $observer)
{
        
        
echo "TEST";
        exit;
}
}

Nobody????

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  870
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

try

<frontend>
        <
events>
            <
checkout_cart_product_add_before>  
                <
observers>  
                    <
check_product_type>  
                        <
type>singleton</type>  
                        <class>
Dg_Pricerulesextended_Model_Observer</class>    
                        <
method>checkProductType</method>            
                    </
check_product_type>
                </
observers>
            </
checkout_cart_product_add_before>  
        </
events>

</
frontend>

 
Magento Community Magento Community
Magento Community
Magento Community
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

thanks for the reply,

but doesnt work either…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ryan Sun _Kuafu
Guru
 
Total Posts:  316
Joined:  2008-11-14
FL
 

there is no ‘checkout_cart_product_add_before’, only ‘checkout_cart_product_add_after’

 
Magento Community Magento Community
Magento Community
Magento Community
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

thanx you where right… tried that event before as well, but was not working at that time..
think i had an other error then..

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top