Joel Azevedo
Joel Azevedo

Reputation: 616

Magento Extension - Add to Cart API call

Let me start to say that I am new to Magento.

I am building a small extension that automatically injects relevant youtube videos to product pages (electronics, books, etc...) and I need to know if the user clicked the 'Add to Cart' button.

Is it possible to know when a user adds a product to the cart via an API call? Other method? Thanks in advance.

Upvotes: 0

Views: 44

Answers (1)

samumaretiya
samumaretiya

Reputation: 1175

You have to write event observer for your custom extension and need to track that when add to cart event is fired you can run your own logic inside this observer.

<events>
		<checkout_cart_product_add_after>
			 <observers>
				<uniquetag>
					<type>singleton</type>
					<class>vendor_module_model_observer</class>
					<method>updatepriceing</method>
				</uniquetag>
			 </observers>
		</checkout_cart_product_add_after>
</events>

However this is not full proof solution but this is what how you can achieve your intended task.

Good luck

Upvotes: 1

Related Questions