1

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!

1

1 Answer 1

1
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')
2
  • in which file ? Commented Jun 7, 2018 at 9:32
  • create a custom module Commented Jun 7, 2018 at 9:49

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.