Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions
DefaultPaymentGateways::get_rules_for_cbd
Get default rules for CBD based on given argument.
Method of the class: DefaultPaymentGateways{}
No Hooks.
Returns
Object. Rules to match.
Usage
$result = DefaultPaymentGateways::get_rules_for_cbd( $should_have );
- $should_have(true|false) (required)
- Whether or not the store should have CBD as an industry (true) or not (false).
DefaultPaymentGateways::get_rules_for_cbd() DefaultPaymentGateways::get rules for cbd code WC 10.5.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(),
);
}