diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-create-product-by-type.ts b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-create-product-by-type.ts index 6232c08b688..7bb1a065dce 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-create-product-by-type.ts +++ b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-create-product-by-type.ts @@ -36,9 +36,12 @@ export const useCreateProductByType = () => { { _fields: [ 'id' ] } ); if ( data && data.id ) { - const link = getAdminLink( + let link = getAdminLink( `post.php?post=${ data.id }&action=edit&wc_onboarding_active_task=products&tutorial=true` ); + if ( type === 'physical' ) { + link += '&spotlight=true'; + } window.location.href = link; } else { throw new Error( 'Unexpected empty data response from server' ); diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-product-layout-experiment.ts b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-product-layout-experiment.ts index e3d440cdada..2d3c2c0baf6 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-product-layout-experiment.ts +++ b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/use-product-layout-experiment.ts @@ -8,9 +8,9 @@ type Layout = 'control' | 'card' | 'stacked'; export const getProductLayoutExperiment = async (): Promise< Layout > => { const [ cardAssignment, stackedAssignment ] = await Promise.all( [ - loadExperimentAssignment( `woocommerce_products_task_layout_card_v2` ), + loadExperimentAssignment( `woocommerce_products_task_layout_card_v3` ), loadExperimentAssignment( - `woocommerce_products_task_layout_stacked_v2` + `woocommerce_products_task_layout_stacked_v3` ), ] ); // This logic may look flawed as in both looks like they can be assigned treatment at the same time, diff --git a/plugins/woocommerce/changelog/fix-re-run-product-task-experiment-v3 b/plugins/woocommerce/changelog/fix-re-run-product-task-experiment-v3 new file mode 100644 index 00000000000..84bfab54929 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-re-run-product-task-experiment-v3 @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Update product task experiment names and add spotlight parameter to physical product template link diff --git a/plugins/woocommerce/src/Admin/API/OnboardingTasks.php b/plugins/woocommerce/src/Admin/API/OnboardingTasks.php index 41d3b2292a1..dc8d38f1338 100644 --- a/plugins/woocommerce/src/Admin/API/OnboardingTasks.php +++ b/plugins/woocommerce/src/Admin/API/OnboardingTasks.php @@ -362,14 +362,14 @@ class OnboardingTasks extends \WC_REST_Data_Controller { */ public static function is_experiment_product_task() { $anon_id = isset( $_COOKIE['tk_ai'] ) ? sanitize_text_field( wp_unslash( $_COOKIE['tk_ai'] ) ) : ''; - $allow_tracking = 'yes' === get_option( 'woocommerce_allow_tracking' ); + $allow_tracking = get_option( 'woocommerce_allow_tracking' ) === 'yes'; $abtest = new \WooCommerce\Admin\Experimental_Abtest( $anon_id, 'woocommerce', $allow_tracking ); - return $abtest->get_variation( 'woocommerce_products_task_layout_stacked_v2' ) === 'treatment' || - $abtest->get_variation( 'woocommerce_products_task_layout_card_v2' ) === 'treatment'; + return $abtest->get_variation( 'woocommerce_products_task_layout_stacked_v3' ) === 'treatment' || + $abtest->get_variation( 'woocommerce_products_task_layout_card_v3' ) === 'treatment'; } /**