In one page checkout I want to make one step instead two separate steps (default is one for shipping, one for payments methods). So I made changes in

  • checkout_index_index - removed payment-steps and moved item name="payment" xsi:type="array" to shipping-step
  • in LayoutProcessor.process changed payment localization to shipping-step
  • in js/view/payment.js removed stepNavigator.registerStep and added this.navigate() which calls getPaymentInformation() and sets block as visible

It worked out but I'm getting message that there are no payments. I think problem is in loading payments list. When are two steps, second step (this with payment) is loaded after clicking on button below shipping methods. This button

  • sends address data to server (setShippingInformation) by calling url /rest/default/V1/guest-carts/xxxx/payment-information
  • get back payments list (and paymentService.setPaymentMethods is called)
  • and then shows second step (stepNavigator.next())

So before showing second step, payments are loaded from server. I could call this url /rest/default/V1/guest-carts/xxxx/payment-information but it requires address data in parameters. So it looks like payments methods can be resolved only after address is filled? But I want to show payments methods just after loading without looking at address.

At the beginnig of payments.js I noticed also this code paymentService.setPaymentMethods(methodConverter(window.checkoutConfig.paymentMethods)); It looks like that this code also loads payments list, so maybe I can assign somewhere in php code payments list to checkoutConfig?

Does anybody known how do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.