Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 2 - Event dispatched when a user clicks "Go To Checkout"

Tags:

What is the name of the event that is dispatched when a customer clicks "Go To Checkout" after adding stuff on their cart? I want to register that a user started a checkout process for analytics. Specifically, I need to capture the contents of the cart and other information such as total price etc.

I've tried most of the events on this list that are related to either "checkout" or "cart". None of them seem to be dispatched when a user clicks checkout. The nearest that I could get was

controller_action_predispatch_checkout_cart_index

which is dispatched when a user clicks "View and Edit Cart".

I'm looking at a couple of ways to solve this

  1. Get the name of the event that is dispatched when a user clicks "Go To Checkout". Observe that event and "hook" my code to it.
  2. Or is there a way to see all the events that are being dispatched in real time? I'm thinking that I might be able to find some other event that is dispatched near the same time as checkout and then observe that one.
like image 545
satnam Avatar asked Jan 22 '16 22:01

satnam


1 Answers

Use controller_action_predispatch_checkout_index_index.

like image 93
Poorvi Dubey Avatar answered Oct 22 '22 00:10

Poorvi Dubey