Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › How to Set default payment Gateway Option?
- This topic has 9 replies, 7 voices, and was last updated 6 years, 11 months ago by
admin.
-
AuthorPosts
-
June 15, 2011 at 8:44 pm #3600
Karen Clark
MemberIs there a way to set the first option on the payments drop down to be a certain thing? Right now the default is PayPal but I would like my Authorize.net to appear first, with PayPal and Manual underneath those options. Thanks!
June 16, 2011 at 2:47 am #33407amin007
ParticipantHere is how you can set a payment gateway to be the default one (when you are offering multiple gateway options).
Add the following block of code in your theme’s functions.php file which will set authorize.net as the default selected option:
add_filter('eStore_cart_checkout_default_gateway', 'override_default_gateway');
function override_default_gateway($gateway)
{
$gateway = 'authorize';
return $gateway;
}Setting Another Payment Gateway as the Default
You can change the word
authorize
with one of the following to set a different gateway as the default option:paypal
(standard PayPal checkout)manual
(manual checkout)2co
(2checkout)authorize
(standard authorize.net checkout)gco
(Google checkout)pppro
(PayPal Pro checkout)auth_aim
(authorize.net AIM onsite checkout)ccbill
(CCBill checkout)stripe
(Stripe checkout)stripe_basic
(Stripe popup checkout)October 28, 2014 at 2:01 pm #33408jfollette
MemberWhy is there not a simple checkbox option to select a default payment gateway rather than having to edit code?
March 16, 2015 at 11:48 am #33409premierweb
MemberI have two payment methods – Direct Deposit and PayPal. Direct deposit is displayed as the first choice but I would like PayPal to be displayed first.
—-
If I add the following block of code to my theme’s functions.php filI presume this will be overwritten whenever the theme is updated:
add_filter(‘eStore_cart_checkout_default_gateway’, ‘override_default_gateway’);
function override_default_gateway($gateway)
{
$gateway = ‘authorize’;
return $gateway;
}
—
Can you please suggest another way to do this? I use Version v7.1.7 of WP eStore.
Thanks
March 16, 2015 at 12:04 pm #33410wzp
ModeratorThe code has to go someplace. And there is really no place “safe” from being overwritten by updates. That’s why, as a business owner, you need to exercise good configuration management controls. After you make the initial changes, simply make a backup of the file. Whenever you update the theme, which should not be very often, simply compare the 2 files and re-implement the modifications if necessary.
March 16, 2015 at 12:07 pm #33411premierweb
MemberUnderstandable. Great advice as usual! Thanks very much.
March 16, 2015 at 10:56 pm #33412admin
KeymasterYou can create a custom little plugin where you add all your custom tweaks. Since it will be your own little plugin with your tweaks, it will never get overwritten by an update.
January 29, 2016 at 5:23 pm #33413jharries
MemberGreat stuff. It constantly amazes me: no matter how obscure the little detail I want to change to make my business work better, a search of this forum yields a solution a good 80% of the time.
Thanks
John
March 17, 2018 at 3:22 pm #33414jharries
MemberGood Morning,
Is there a code to make Strip Basic the default payment method instead of Paypal? I tried “stripe” but that seems to only work with normal stripe.
I also looked in the code, but was not smart enough to find it.
Thanks
John
March 18, 2018 at 5:16 am #33415admin
KeymasterUse the following:
stripe_basic
-
AuthorPosts
- You must be logged in to reply to this topic.