Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

DefaultPaymentGateways::get_rules_for_cbd()public staticWC 1.0

Get default rules for CBD based on given argument.

Метод класса: DefaultPaymentGateways{}

Хуков нет.

Возвращает

Массив. Rules to match.

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

$result = DefaultPaymentGateways::get_rules_for_cbd( $should_have );
$should_have(true|false) (обязательный)
Whether or not the store should have CBD as an industry (true) or not (false).

Код DefaultPaymentGateways::get_rules_for_cbd() WC 7.1.0

public static function get_rules_for_cbd( $should_have ) {
	return (object) array(
		'type'         => 'option',
		'transformers' => array(
			(object) array(
				'use'       => 'dot_notation',
				'arguments' => (object) array(
					'path' => 'industry',
				),
			),
			(object) array(
				'use'       => 'array_column',
				'arguments' => (object) array(
					'key' => 'slug',
				),
			),
		),
		'option_name'  => 'woocommerce_onboarding_profile',
		'operation'    => $should_have ? 'contains' : '!contains',
		'value'        => 'cbd-other-hemp-derived-products',
		'default'      => array(),
	);
}