Default payment
-
We have been using WP Express Checkout for some years alongside Stripe Checkout with the Avada theme. We recently dropped Avada and now use Storefront. Bothe WPEC and Stripe work just fine with Storefront however we want the Stripe payment to be preselected (default) payment method.
We had a plugin (see below) that did this just fine before but it doesnt work now. Both the Paypal and Stripe buttons are equally selectable but stripe is not set as default. Has anything changed at WPEC.<?php /** * Plugin Name: Default Stripe Payment Method * Plugin URI: https://trapbarn.com * Description: Plugin which select Stripe payment menthod always as default * Version: 1.0 * Author: Alex Kantajevs (virus) * Author URI: https://virus707.me/ **/ add_action( 'template_redirect', 'define_default_payment_gateway' ); function define_default_payment_gateway(){ if( is_checkout() && ! is_wc_endpoint_url() ) { $default_payment_id = 'stripe'; WC()->session->set( 'chosen_payment_method', $default_payment_id ); } } ?>The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Default payment’ is closed to new replies.