diff --git a/e2e-tests/specs/onboarding.spec.js b/e2e-tests/specs/onboarding.spec.js index f9a02a47..67605aac 100644 --- a/e2e-tests/specs/onboarding.spec.js +++ b/e2e-tests/specs/onboarding.spec.js @@ -127,7 +127,7 @@ test.describe('Onboarding', () => { page.getByRole('heading', { name: 'We are importing your new' }), ).toBeVisible(); - await page.waitForSelector('.ob-import-done', { timeout: 10000 }); + await page.waitForSelector('.ob-import-done', { timeout: 60000 }); await expect(page.getByRole('textbox', { name: 'Enter your email' })).toBeVisible(); await expect(page.locator('#inspector-select-control-0')).toBeVisible(); // User experience selector. diff --git a/includes/Admin.php b/includes/Admin.php index 49223219..ec4b873a 100755 --- a/includes/Admin.php +++ b/includes/Admin.php @@ -75,6 +75,7 @@ public function init() { add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) ); add_filter( 'ti_tpc_editor_data', array( $this, 'add_tpc_editor_data' ), 20 ); add_action( 'admin_init', array( $this, 'activation_redirect' ) ); + add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) ); $this->setup_white_label(); @@ -719,6 +720,8 @@ public function enqueue() { ); } } + + do_action( 'themeisle_internal_page', TIOB_BASENAME, 'onboarding' ); } $is_tiob_page = strpos( $screen->id, '_page_tiob-plugin' ) !== false; @@ -746,6 +749,8 @@ public function enqueue() { wp_enqueue_script( 'tiob' ); wp_set_script_translations( 'tiob', 'templates-patterns-collection' ); + + do_action( 'themeisle_internal_page', TIOB_BASENAME, 'onboarding' ); } /** @@ -1390,4 +1395,30 @@ private function get_prefix_for_menu_item() { return $prefix; } + + /** + * Add Black Friday data. + * + * @param array $configs The configuration array for the loaded products. + * + * @return array + */ + public function add_black_friday_data( $configs ) { + $config = $configs['default']; + + // translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name. + $message_template = __( 'Brought to you by the team behind %1$s— our biggest sale of the year is here: %2$sup to %3$s OFF%4$s on premium products from %5$s! Limited-time only.', 'templates-patterns-collection' ); + + $config['message'] = sprintf( $message_template, 'Starter Sites & Templates by Neve', '', '70%', '', 'Themeisle' ); + $config['sale_url'] = add_query_arg( + array( + 'utm_term' => 'free', + ), + tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/all-bf', 'bfcm', 'templates-patterns-collection' ) ) + ); + + $configs[ TIOB_BASENAME ] = $config; + + return $configs; + } }