Fix obw free extension rules for the marketing task with php 8 (#33291)

* Fix obw free extensions api for marketing task with php8

* Add changelog

* Fix wcpay cbd rule
This commit is contained in:
Chi-Hsuan Huang 2022-06-02 13:13:44 +08:00 committed by GitHub
parent c0619dc597
commit 5d076cc7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 28 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix obw free extension rules for the marketing task with php 8

View File

@ -5,6 +5,8 @@
namespace Automattic\WooCommerce\Internal\Admin\RemoteFreeExtensions;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways;
defined( 'ABSPATH' ) || exit;
@ -235,34 +237,8 @@ class DefaultFreeExtensions {
'operation' => '=',
],
],
[
'type' => 'option',
'transformers' => [
[
'use' => 'dot_notation',
'arguments' => [
'path' => 'industry',
],
],
[
'use' => 'array_column',
'arguments' => [
'key' => 'slug',
],
],
[
'use' => 'array_search',
'arguments' => [
'value' => 'cbd-other-hemp-derived-products',
],
],
],
'option_name' => 'woocommerce_onboarding_profile',
'value' => 'cbd-other-hemp-derived-products',
'default' => '',
'operation' => '!=',
],
],
DefaultPaymentGateways::get_rules_for_cbd( false ),
],
'is_built_by_wc' => true,
],
@ -307,7 +283,7 @@ class DefaultFreeExtensions {
],
'option_name' => 'woocommerce_onboarding_profile',
'value' => 1,
'default' => '',
'default' => array(),
'operation' => '!=',
],
],