PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.3
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.3
1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 All 178 releases
disco / notice / PromotionalNotice.php

PromotionalNotice.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.3, at notice/PromotionalNotice.php

73 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Disco\Notice;
4
5 use Disco\App\Disco;
6
7 class PromotionalNotice {
8 public function __construct() {
9 // add_action( 'admin_notices', [ $this, 'display_promotional_notice' ] );
10 }
11
12 /**
13 * Display the promotional notice.
14 *
15 * @return void
16 */
17 public function display_promotional_notice() {
18
19 if( Disco::is_pro() ) {
20 return;
21 }
22
23 global $pagenow;
24
25 $allowed_pages = [
26 'index.php', // Dashboard
27 ];
28
29 $plugin_page_slug = 'disco-create-discount';
30
31 // If NOT dashboard AND NOT your plugin page → return
32 if (
33 ! in_array( $pagenow, $allowed_pages, true ) &&
34 ( ! isset( $_GET['page'] ) || $_GET['page'] !== $plugin_page_slug )
35 ) {
36 return;
37 }
38
39 // Stop if user is not logged in
40 if ( ! is_user_logged_in() ) {
41 return;
42 }
43
44
45 $current_time = time();
46
47 $promo_start = strtotime('2025-12-01 00:00:00');
48 $promo_end = strtotime('2026-01-05 11:59:00');
49
50 // If not in promotion window, don't show
51 if ( $current_time < $promo_start || $current_time > $promo_end ) {
52 return;
53 }
54
55 $user_id = get_current_user_id();
56 $dismiss = get_user_meta( $user_id, 'disco_promotional_holiday_banner_2025', true );
57
58 if ( $dismiss === 'never' ) {
59 return; // User dismissed permanently
60 }
61
62 ?>
63 <div class="disco-promotional-notice-wrapper">
64 <div class="notice notice-success is-dismissible disco-promotional-notice">
65 <a href="https://discoplugin.com/pricing/?utm_source=Floating-Holiday&utm_medium=free-to-pro&utm_campaign=H-Holiday&utm_id=1" target="_blank">
66 <img src="<?php echo esc_url( plugins_url( 'assets/img/promotional/holiday_promotional_banner_2025.png', DISCO_PLUGIN_ABSOLUTE ) ); ?>" alt="Promotional Banner" style="max-width: 100%; height: auto;">
67 </a>
68 </div>
69 </div>
70 <?php
71 }
72 }
73