Magento2 – Before Place Order in Onepage Checkout

checkoutmagento2onepage-checkout

I'm struggling to override or get in the middle of some checkout action scripts, for example the place-order method of app/code/Magento/Checkout/view/frontend/web/js/view/review.js

I can see there is a "beforePlaceOrder" variable in there but I'm unsure how to subscribe my own method there.

Best Answer

The code you described is not in magento 2 anymore. Checkout has been modified.

You can substitute any action (and any requireJs component) using requireJs map configuration (http://requirejs.org/docs/api.html#config-map) in magento requireJs config files.

Interception (or mixins) feature is not yet implemented for JS) but it's in development right now and will be delivered pretty soon.

Related Topic