Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

DefaultPaymentGateways::get_rules_for_selling_venues()public staticWC 1.0

Get rules that match the store's selling venues.

{} It's a method of the class: DefaultPaymentGateways{}

No Hooks.

Return

Object. Rules to match.

Usage

$result = DefaultPaymentGateways::get_rules_for_selling_venues( $selling_venues );
$selling_venues(array) (required)
Array of venues to match.

Code of DefaultPaymentGateways::get_rules_for_selling_venues() WC 7.1.0

public static function get_rules_for_selling_venues( $selling_venues ) {
	$rules = array();

	foreach ( $selling_venues as $venue ) {
		$rules[] = (object) array(
			'type'         => 'option',
			'transformers' => array(
				(object) array(
					'use'       => 'dot_notation',
					'arguments' => (object) array(
						'path' => 'selling_venues',
					),
				),
			),
			'option_name'  => 'woocommerce_onboarding_profile',
			'operation'    => '=',
			'value'        => $venue,
			'default'      => array(),
		);
	}

	return (object) array(
		'type'     => 'or',
		'operands' => $rules,
	);
}