cancel
Showing results for 
Search instead for 
Did you mean: 

Add to Cart call inside extension

SOLVED

Add to Cart call inside extension

I, I am new to Magento and I need to build a simple extension that injects relevant videos to product pages.

 

 I want to know if it is possible, inside an extension, to know if a user made a click on Add to Cart. If yes, how?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Add to Cart call inside extension

Maybe you can use observers. You can listen for checkout_cart_product_add_before event to do something.

There are another events like:

  • checkout_cart_add_product_complete
  • checkout_cart_product_add_after

Listening for those events you'll be able to trigger any other action.

More about Magento observers: http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-1.html#8

View solution in original post

2 REPLIES 2

Re: Add to Cart call inside extension

Maybe you can use observers. You can listen for checkout_cart_product_add_before event to do something.

There are another events like:

  • checkout_cart_add_product_complete
  • checkout_cart_product_add_after

Listening for those events you'll be able to trigger any other action.

More about Magento observers: http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-1.html#8

Re: Add to Cart call inside extension

Thanks Damien, I think that's it Smiley Happy Cheers