#2856583: Allow free orders (checkout without payment) →
allows users to check out with zero cost orders and properly hides the payment method add form in the payment info pane during checkout, but only if the order total is already zero when the user first loads the checkout step page with that pane.
However, when the order total is adjusted to zero via a promotion and the form is reloaded via ajax, the payment method add form remains until the page is fully reloaded.
And if the page has been reloaded and the payment method form is not displayed, it will not reappear if the promotion is removed and the form reloaded via ajax.
Steps to reproduce:
- Have a promotion that can reduce the order cost by 100%.
- Have a payment gateway that implements SupportsCreatingPaymentMethodsInterface
.
- Include the Payment Information pane (Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentInformation) in the checkout flow.
- Include the Coupon redemption pane in the same step of the same checkout flow.
- During checkout, apply the 100% promotion.
Expected result:
The payment method form should not appear after the promotion form is submitted via ajax and the order total is reduced to $0.
Actual result:
The payment method form still appears even though the order total displays as $0. A full page refresh results does remove the payment method form.
Further steps:
- Fully reload the checkout page with the payment info and coupon redemption.
- Remove the 100% promotion.
Expected result:
The payment method form should appear after the promotion is removed via ajax.
Actual result:
The payment method form does not appear until the page is fully reloaded.