0

I'm stuck in this. The checkout_cart_update_items_after is not firing. I already put a log statement in the function but is not getting executed. Whereas checkout_cart_product_add_after is working fine.

<checkout_cart_product_add_after>
            <observers>
                <ysindia_customer_model_observer>
                    <type>singleton</type>
                    <class>Ysindia_Customer_Model_Observer</class>
                    <method>itemAdded</method>
                </ysindia_customer_model_observer>
            </observers>
        </checkout_cart_product_add_after>
        <checkout_cart_update_items_after>
            <observers>
                <ysindia_customer_model_observer>
                    <type>singleton</type>
                    <class>Ysindia_Customer_Model_Observer</class>
                    <method>checkCart</method>
                </ysindia_customer_model_observer>
            </observers>
</checkout_cart_update_items_after>

Observer.php

class Ysindia_Customer_Model_Observer
{

public function checkCart(Varien_Event_Observer $observer){
     Mage::log("Items after", null, 'observer.log');
}

public function itemAdded(Varien_Event_Observer $observer)
{
    Mage::log("Add after", null, 'observer.log');
}

}

Please help me, thanks

3
  • How you check checkout_cart_update_items_after event?
    – kuba_ceg
    Commented Sep 3, 2015 at 9:27
  • I'm checking in a log file, checkout_cart_product_add_after log I can see but not checkout_cart_update_items_after.
    – Ashutosh
    Commented Sep 3, 2015 at 9:29
  • Yeach, I remember that :) I mean how you trigger this events? checkout_cart_update_items_after is triggered e.g. after qty update in cart.
    – kuba_ceg
    Commented Sep 3, 2015 at 11:21

2 Answers 2

0

Try replacing the type of your observer by Model instead of singleton:

<checkout_cart_product_add_after>
            <observers>
                <ysindia_customer_model_observer>
                    <type>model</type>
                    <class>Ysindia_Customer_Model_Observer</class>
                    <method>itemAdded</method>
                </ysindia_customer_model_observer>
            </observers>
        </checkout_cart_product_add_after>
        <checkout_cart_update_items_after>
            <observers>
                <ysindia_customer_model_observer>
                    <type>model</type>
                    <class>Ysindia_Customer_Model_Observer</class>
                    <method>checkCart</method>
                </ysindia_customer_model_observer>
            </observers>
</checkout_cart_update_items_after>
-1

Try with checkout_cart_product_update_after event if that help you.

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.