Skip to content

Commit 8ea07b1

Browse files
Merge pull request #86 from Codeinwp/feat/black-friday
feat: add Black Friday integration
2 parents 78bd556 + 6a2bde7 commit 8ea07b1

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_jaxon_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
/**
@@ -338,4 +339,31 @@ function( $data, $page_slug ) {
338339
);
339340
do_action( 'themeisle_internal_page', JAXON_PRODUCT_SLUG, $screen->id );
340341
}
342+
343+
/**
344+
* Add Black Friday data.
345+
*
346+
* @param array $configs The configuration array for the loaded products.
347+
*
348+
* @return array
349+
*/
350+
public function add_black_friday_data( $configs ) {
351+
$config = $configs['default'];
352+
353+
// translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name.
354+
$message_template = __( 'Enhance %1$s with %2$s– up to %3$s OFF in our biggest sale of the year. Limited time only.', 'jaxon' );
355+
356+
$config['dismiss'] = true; // Note: Allow dismiss since it appears on `/wp-admin`.
357+
$config['message'] = sprintf( $message_template, 'Jaxon', 'Otter Blocks Pro', '70%' );
358+
$config['sale_url'] = add_query_arg(
359+
array(
360+
'utm_term' => 'free',
361+
),
362+
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/otter-bf', 'bfcm', 'jaxon' ) )
363+
);
364+
365+
$configs[ JAXON_PRODUCT_SLUG ] = $config;
366+
367+
return $configs;
368+
}
341369
}

0 commit comments

Comments
 (0)