| @@ -787,8 +787,23 @@ | ||
| 787 | 787 | $firstMethod = reset($activePaymentMethods); |
| 788 | 788 | $selectedPaymentMethod = $firstMethod ? $firstMethod->getMeta('route') : ''; |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | + /** | |
| 792 | + * The payment method rendered as checked. An add-on that renders its own | |
| 793 | + * selector outside this list (e.g. saved payment methods) returns a route | |
| 794 | + * that is not in the list, so no gateway here is checked — the page then | |
| 795 | + * arrives with the add-on's choice already selected instead of a gateway | |
| 796 | + * being checked first and switched over by JS after load. | |
| 797 | + * | |
| 798 | + * @param string $selectedPaymentMethod | |
| 799 | + * @param array $context ['cart' => Cart, 'payment_methods' => array] | |
| 800 | + */ | |
| 801 | + $selectedPaymentMethod = (string) apply_filters('fluent_cart/checkout/selected_payment_method', $selectedPaymentMethod, [ | |
| 802 | + 'cart' => $this->cart, | |
| 803 | + 'payment_methods' => $activePaymentMethods | |
| 804 | + ]); | |
| 805 | + | |
| 791 | 806 | $checkoutMethodStyle = $this->storeSettings->get('checkout_method_style', 'logo'); |
| 792 | 807 | |
| 793 | 808 | ?> |
| 794 | 809 | <div id="fluent_payment_methods" class="fluent_payment_methods"> |