Update product task experiment names to re-run (#34495)
* Update product task experiment names to re-run experiment * Add spotlight parameter experimental product task menu * Changelog * Fix yoda
This commit is contained in:
parent
ea8b44115b
commit
c7015da14e
|
@ -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' );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Update product task experiment names and add spotlight parameter to physical product template link
|
|
@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue