Altering badge logic to function based on experiments instead of feature flag

This commit is contained in:
Joel T 2022-04-25 14:30:29 -07:00
parent 6693e9fba8
commit 3b28616640
1 changed files with 5 additions and 2 deletions

View File

@ -468,11 +468,14 @@ class TaskLists {
* @return number
*/
public static function setup_tasks_remaining () {
if( ! Features::is_enabled( 'tasklist-setup-experiment-1' )) {
$active_list = self::is_experiment_treatment( 'woocommerce_tasklist_setup_experiment_1' ) ? 'setup_experiment_1' : self::is_experiment_treatment( 'woocommerce_tasklist_setup_experiment_2' ) ? 'setup_experiment_1' : null;
if( is_null( $active_list ) ) {
return;
}
$setup_list = self::get_list( 'setup_experiment_1' );
$setup_list = self::get_list( $active_list );
if( $setup_list->is_hidden() || $setup_list->is_complete() ) {
return;