woocommerce/plugins
Gan Eng Chin 6802b2720a
Add Default Fallback Marketing Channel Recommendations (#43001)
* Add MarketingRecommendations feature.

The code here is based on other feature with default fallbacks and with data source poller, e.g. see payment gateway suggestions.

* Use MarketingRecommendations feature in API.

* Add spec_key for MarketingRecommendationsDataSourcePoller.

If we don't specify it, the default is `id`, which is not used in our recommendation data, and this will cause things not to work as expected.

* Recursively convert object to array.

This is because all the subsequent functions work with arrays, not objects.

* Make recommended marketing tools and coupons use MarketingRecommendationsInit.

This is so that recommended channels, tools, and coupons make use of the same transient data with data source poller.

* Add changelog.

* Fix PHP lint issues.

* Add doc comment to fix lint error.

* Fix tests in MarketingRecommendationsTest.

* Replace recommendations.json file with generated data in DefaultMarketingRecommendations.

This is to have i18n support.

* Add icons for fallback marketing recommendations.

* Fix PHP linting issue.

* Fix linting issue.

* Fix failing tests with PHP 8.0.

* Remove unused replaced code in MarketingSpecs.

* Remove unneeded false check.

This is because `is_array` would return `false` when `false` is being passed as the argument.

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>

---------

Co-authored-by: Bartosz Budzanowski <bartosz.budzanowski@automattic.com>
2024-01-10 18:39:59 +08:00
..
woo-ai Add React Testing Library to the Woo AI plugin. (#42993) 2023-12-21 12:25:08 +01:00
woocommerce Add Default Fallback Marketing Channel Recommendations (#43001) 2024-01-10 18:39:59 +08:00
woocommerce-admin Redirect Woo.com connect request to selected page (#43315) 2024-01-10 07:20:15 +01:00
woocommerce-beta-tester [Woo beta tester]: add User Preference panel (#43125) 2024-01-03 17:42:18 -03:00
woocommerce-blocks [Experimental] Product Gallery Pager: Improve accessibility (#43348) 2024-01-09 10:48:49 +01:00
woocommerce-docs Fixed WooCommerce Docs Build Errors (#42000) 2023-12-10 22:39:00 -08:00