HomeBlogQuestionsWoocommerce get available payment gateways ?

Woocommerce get available payment gateways ?

To get the available payment gateways in WooCommerce, you can go to the WooCommerce settings in the WordPress admin dashboard and navigate to the “Payments” tab. Here, you will find a list of all the available payment gateways that are installed and activated on your WooCommerce site. You can also install and activate additional payment gateways through this settings page if needed. WooCommerce offers a wide range of payment gateway options such as PayPal, Stripe, Authorize.Net, and many more, allowing you to choose the ones that best suit your business needs and preferences.


One way to get the available payment gateways in WooCommerce is to use the `WC_Payment_Gateways` class. Here’s an example of how you can retrieve the list of available payment gateways:


// Get the available payment gateways

$payment_gateways = WC()->payment_gateways->get_available_payment_gateways();

// Loop through each payment gateway

foreach ($payment_gateways as $gateway) {

// Get the gateway ID and title

$gateway_id = $gateway->id;

$gateway_title = $gateway->title;

// Do something with the gateway ID and title

echo 'Gateway ID: ' . $gateway_id . ', ';

echo 'Gateway Title: ' . $gateway_title . '


This code snippet retrieves the available payment gateways through the `get_available_payment_gateways()` method of the `WC_Payment_Gateways` class. It then loops through each gateway and retrieves the ID and title of each gateway. You can modify this code to suit your needs, whether you want to display the payment gateways on a page or perform any other actions with them.


Leave a Reply

Your email address will not be published. Required fields are marked *

WP Payment Gateways

Unlock the full potential of your WordPress site with our WP gateways plugins. Get started today and start monetizing your website like a Pro.


Our partners

© 2024 · WPayo.com · WordPress Payment Gateways Plugins

  • Home
  • Payment Plugins
  • WP Gateways For WordPress
  • Pricing