WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Admin_Setup_Wizard::get_wizard_in_cart_payment_gateways() public WC 1.0

Simple array of "in cart" gateways to show in wizard.

Это метод класса: WC_Admin_Setup_Wizard{}

Хуков нет.

Возвращает

Массив.

Использование

$WC_Admin_Setup_Wizard = new WC_Admin_Setup_Wizard();
$WC_Admin_Setup_Wizard->get_wizard_in_cart_payment_gateways();

Код WC_Admin_Setup_Wizard::get_wizard_in_cart_payment_gateways() WC 4.5.2

woocommerce/includes/admin/class-wc-admin-setup-wizard.php
<?php
public function get_wizard_in_cart_payment_gateways() {
	$gateways = $this->get_wizard_available_in_cart_payment_gateways();
	$country  = WC()->countries->get_base_country();
	$currency = get_woocommerce_currency();

	$can_stripe  = $this->is_stripe_supported_country( $country );
	$can_eway    = $this->is_eway_payments_supported_country( $country );
	$can_payfast = ( 'ZA' === $country ); // South Africa.
	$can_paypal  = $this->is_paypal_supported_currency( $currency );

	if ( ! current_user_can( 'install_plugins' ) ) {
		return $can_paypal ? array( 'paypal' => $gateways['paypal'] ) : array();
	}

	$klarna_or_square = false;

	if ( $this->is_klarna_checkout_supported_country( $country ) ) {
		$klarna_or_square = 'klarna_checkout';
	} elseif ( $this->is_klarna_payments_supported_country( $country ) ) {
		$klarna_or_square = 'klarna_payments';
	} elseif ( $this->is_square_supported_country( $country ) && get_option( 'woocommerce_sell_in_person' ) ) {
		$klarna_or_square = 'square';
	}

	$offered_gateways = array();

	if ( $can_stripe ) {
		$gateways['stripe']['enabled']  = true;
		$gateways['stripe']['featured'] = true;
		$offered_gateways              += array( 'stripe' => $gateways['stripe'] );
	} elseif ( $can_paypal ) {
		$gateways['ppec_paypal']['enabled'] = true;
	}

	if ( $klarna_or_square ) {
		if ( in_array( $klarna_or_square, array( 'klarna_checkout', 'klarna_payments' ), true ) ) {
			$gateways[ $klarna_or_square ]['enabled']  = true;
			$gateways[ $klarna_or_square ]['featured'] = false;
			$offered_gateways                         += array(
				$klarna_or_square => $gateways[ $klarna_or_square ],
			);
		} else {
			$offered_gateways += array(
				$klarna_or_square => $gateways[ $klarna_or_square ],
			);
		}
	}

	if ( $can_paypal ) {
		$offered_gateways += array( 'ppec_paypal' => $gateways['ppec_paypal'] );
	}

	if ( $can_eway ) {
		$offered_gateways += array( 'eway' => $gateways['eway'] );
	}

	if ( $can_payfast ) {
		$offered_gateways += array( 'payfast' => $gateways['payfast'] );
	}

	return $offered_gateways;
}