Is there an event for the checkout when you choose the payment method?
So when the site where you choose the payment method is called I want the event to trigger.
Thanks!
Is there an event for the checkout when you choose the payment method?
So when the site where you choose the payment method is called I want the event to trigger.
Thanks!
require 'Magento_Checkout/js/model/quote';
Observer:
quote.paymentMethod.subscribe(function(){console.log('test')}, null, 'change');
You will find plenty of observe there
var billingAddress = ko.observable(null);
var shippingAddress = ko.observable(null);
var shippingMethod = ko.observable(null);
var paymentMethod = ko.observable(null);
var totals = ko.observable(totalsData);
var collectedTotals = ko.observable({})
if you want to check the payment method inside a function, you can use first argument, like:
quote.paymentMethod.subscribe(function(method){console.log(method);}, null, 'change')