I want to overide the function _onClickPay of the checkout_form.js inside the payment module to add code before the redirection. How can i do that?
(The function is in : addons/payment/static/src/js/checkout_form.js)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to overide the function _onClickPay of the checkout_form.js inside the payment module to add code before the redirection. How can i do that?
(The function is in : addons/payment/static/src/js/checkout_form.js)
Hi,
To override the _onClickPay function in the checkout_form.js
file of the payment module, you can create a custom module in Odoo and
define your custom JavaScript code to replace or extend the existing
function. Here's an example:
odoo.define('custom_payment_module.checkout_form', function (require) { 'use strict';
var CheckoutForm = require('payment.checkout_form');
CheckoutForm.include({
_onClickPay: function (ev) {
// Add your custom code here before redirection
// Call the original _onClickPay function
this._super.apply(this, arguments);
// Add your custom code here after redirection
},
});
return CheckoutForm;
});
Hope it helps
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 3 24
|
2290 | ||
|
0
thg 4 24
|
1573 | ||
|
2
thg 1 24
|
1672 | ||
|
1
thg 8 24
|
1013 | ||
|
0
thg 4 24
|
1212 |