0

please help me how to override the default place order button functionality in Magento during cash on delivery selection

1
  • why you want to overide? Commented Nov 27, 2023 at 4:52

1 Answer 1

0

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);
}});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.