Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
DefaultPaymentGateways::get_rules_for_countries()
Get rules that match the store base location to one of the provided countries.
Method of the class: DefaultPaymentGateways{}
No Hooks.
Return
Object
. Rules to match.
Usage
$result = DefaultPaymentGateways::get_rules_for_countries( $countries );
- $countries(array) (required)
- Array of countries to match.
DefaultPaymentGateways::get_rules_for_countries() DefaultPaymentGateways::get rules for countries code WC 9.7.1
public static function get_rules_for_countries( $countries ) { $rules = array(); foreach ( $countries as $country ) { $rules[] = (object) array( 'type' => 'base_location_country', 'value' => $country, 'operation' => '=', ); } return (object) array( 'type' => 'or', 'operands' => $rules, ); }