please help me how to override the default place order button functionality in Magento during cash on delivery selection
1 Answer
if you want to override the default place order Button so you need to mixin below file in your extenion
vendor/magento/module-checkout/view/frontend/web/js/view/payment/default.js
Your_vendorname/Your_extension_name/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Checkout/js/view/payment/default': {
'Your_ExtrenionsName/js/view/payment/default-mixin': true
}
}
}};
Your_vendorname/Your_extension_name/view/frontend/web/js/view/payment/default-mixin.js
define([
'jquery',
'ko'
], function($, ko) {
'use strict';
var mixin = {
initialize: function() {
this._super();
},
placeOrder: function (data, event) {
// You set action on place order button
}
};
return function(target) {
return target.extend(mixin);
}});