diff --git a/assets/css/_black-friday.scss b/assets/css/_black-friday.scss new file mode 100644 index 0000000..29c9b54 --- /dev/null +++ b/assets/css/_black-friday.scss @@ -0,0 +1,57 @@ +.notice.notice-black-friday { + position: relative; + .notice-content { + width: 85%; + h3{ + font-size: 1.5rem; + } + } + .notice-footer { + justify-content: space-between; + .footer-btn { + display: flex; + gap: 20px; + } + .black-friday-dismiss-btn{ + position: absolute; + top: 12px; + right: 12px; + background-color: transparent; + border-color: transparent; + color: #64748B; + &:hover { + color: #000; + } + } + .black-friday-footer-text { + float: right; + color: #8c8f94; + } + } + @media screen and (max-width: 500px ) { + .notice-body { + align-items: flex-start; + h3{ + font-size: 18px; + } + } + .notice-footer { + flex-direction: column; + .footer-btn { + flex-direction: column; + align-items: center; + gap: 10px; + } + .black-friday-dismiss-btn { + top: -6px; + right: 3px; + z-index: 1; + padding: 0; + color: red; + } + .btn-text{ + display: none; + } + } + } +} diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 086f38b..54cebe0 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -1,4 +1,4 @@ -@import "halloween.scss"; +@import "black-friday.scss"; .bk-card { &.promo-panel{ background: #2563eb; diff --git a/assets/images/black-friday-icon.svg b/assets/images/black-friday-icon.svg new file mode 100644 index 0000000..bf7f905 --- /dev/null +++ b/assets/images/black-friday-icon.svg @@ -0,0 +1,15 @@ + diff --git a/includes/Admin/Notices.php b/includes/Admin/Notices.php index 0f33b6f..6dc6761 100644 --- a/includes/Admin/Notices.php +++ b/includes/Admin/Notices.php @@ -30,16 +30,16 @@ public function admin_notices() { $installed_time = get_option( 'wc_min_max_quantities_installed' ); $current_time = wp_date( 'U' ); - // Halloween's promotion notice. - $halloween_time = date_i18n( strtotime( '2024-11-11 00:00:00' ) ); - if ( $current_time < $halloween_time ) { + // Promotional notice for Black Friday. + $offer_time = date_i18n( strtotime( '2024-12-07 00:00:00' ) ); + if ( $current_time < $offer_time ) { wc_min_max_quantities()->notices->add( array( - 'message' => __DIR__ . '/views/notices/halloween.php', + 'message' => __DIR__ . '/views/notices/black-friday.php', + 'notice_id' => 'wcmmq_black_friday_promotion_24', + 'class' => 'notice-black-friday', + 'style' => 'border-left-color:#2271b1;', 'dismissible' => false, - 'notice_id' => 'wcmmq_halloween_promotion', - 'style' => 'border-left-color: #8500ff;background-image: url("' . esc_url( wc_min_max_quantities()->get_assets_url( 'images/halloween-banner.svg' ) ) . '");', - 'class' => 'notice-halloween', ) ); } @@ -49,7 +49,7 @@ public function admin_notices() { array( 'message' => __DIR__ . '/views/notices/upgrade.php', 'notice_id' => 'wcmmq_upgrade', - 'style' => 'border-left-color: #0542fa;', + 'style' => 'border-left-color:#0542fa;', 'dismissible' => false, ) ); diff --git a/includes/Admin/views/notices/black-friday.php b/includes/Admin/views/notices/black-friday.php new file mode 100644 index 0000000..2190ae0 --- /dev/null +++ b/includes/Admin/views/notices/black-friday.php @@ -0,0 +1,51 @@ + +
+ ' . esc_attr( '40% OFF' ) . '', + '' . esc_attr( 'FLASH40' ) . '' + ) + ); + ?> +
+