How can I get the data when I click the place order button on the checkout page of the Magento 2?
When clicking button place order, show the output data like var_dump ($data); die ();
so as not to redirect to checkout success.
Thank you so much.
2 Answers
Use this extension and modify as per your requirement.
1 https://github.com/navinbhudiya/magento2-order-details-on-success-page
2 https://bsscommerce.com/magento-2-order-details-on-success-page.html
-
Hi Biren Patel, I want var_dump data immediately after submitting, and the data show shows that current checkout page. Thank you for your support– RiverCommented Apr 10, 2019 at 6:54
Following class is responsible for placing the order.
vendor/magento/module-checkout/Model/PaymentInformationManagement.php
And method:
savePaymentInformationAndPlaceOrder
You can debug here. This is api class and you can't get data as $data. All data are passes here as an object.
Also, you can throw an exception here for avoiding success page.