@inpsydekrystian This isn’t a different topic, but the same problem reported by the author. In my post, I explained how this change “fixed” the problem and the client can now use the latest working version. I think it might be useful for you as well when debugging.
Hi,
I noticed that your plugin (advanced payments with cards) only works if the payment tab is opened immediately.
I fixed this bug by forcing the gateway selection in WooCommerce with the following snippet:
// Always force “ppcp-credit-card-gateway” as the default payment method
add_filter(‘woocommerce_default_payment_gateway’, function () {
return ‘ppcp-credit-card-gateway’;
});
add_action(‘woocommerce_before_checkout_form’, function () {
WC()->session->set(‘chosen_payment_method’, ‘ppcp-credit-card-gateway’);
});
add_action(‘woocommerce_before_cart’, function () {
WC()->session->set(‘chosen_payment_method’, ‘ppcp-credit-card-gateway’);
});