Skip to content

Commit 1be29db

Browse files
Merge pull request #161 from Codeinwp/feat/black-friday
feat: add Black Friday support
2 parents e3c2826 + 11a9ac0 commit 1be29db

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

inc/Admin.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function setup_admin_hooks() {
3737

3838
add_action( 'enqueue_block_editor_assets', array( $this, 'add_fse_design_pack_notice' ) );
3939
add_action( 'wp_ajax_raft_dismiss_design_pack_notice', array( $this, 'remove_design_pack_notice' ) );
40+
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) );
4041
}
4142

4243
/**
@@ -411,4 +412,31 @@ function( $data, $page_slug ) {
411412
);
412413
do_action( 'themeisle_internal_page', RAFT_PRODUCT_SLUG, $screen->id );
413414
}
415+
416+
/**
417+
* Add Black Friday data.
418+
*
419+
* @param array $configs The configuration array for the loaded products.
420+
*
421+
* @return array
422+
*/
423+
public function add_black_friday_data( $configs ) {
424+
$config = $configs['default'];
425+
426+
// translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name.
427+
$message_template = __( 'Enhance %1$s with %2$s– up to %3$s OFF in our biggest sale of the year. Limited time only.', 'raft' );
428+
429+
$config['dismiss'] = true; // Note: Allow dismiss since it appears on `/wp-admin`.
430+
$config['message'] = sprintf( $message_template, 'Raft', 'Otter Blocks Pro', '70%' );
431+
$config['sale_url'] = add_query_arg(
432+
array(
433+
'utm_term' => 'free',
434+
),
435+
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/otter-bf', 'bfcm', 'raft' ) )
436+
);
437+
438+
$configs[ RAFT_PRODUCT_SLUG ] = $config;
439+
440+
return $configs;
441+
}
414442
}

0 commit comments

Comments
 (0)