From 353791d7f7c8f8635f76247a06609a45f3d6e29f Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Sun, 24 Nov 2024 16:20:07 +0600 Subject: [PATCH 1/3] Fix #184 --- assets/css/_black-friday.scss | 57 +++++++++++++++++++ assets/css/admin.scss | 2 +- assets/images/black-friday-icon.svg | 15 +++++ includes/Admin/Notices.php | 16 +++--- includes/Admin/views/notices/black-friday.php | 51 +++++++++++++++++ languages/wc-min-max-quantities.pot | 40 ++++++++++--- 6 files changed, 163 insertions(+), 18 deletions(-) create mode 100644 assets/css/_black-friday.scss create mode 100644 assets/images/black-friday-icon.svg create mode 100644 includes/Admin/views/notices/black-friday.php 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..724493b 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..0849ff3 --- /dev/null +++ b/includes/Admin/views/notices/black-friday.php @@ -0,0 +1,51 @@ + +
+
+ WooCommerce Min-Max Quantities Black Friday Offer +
+
+

+ +

+

+ ' . esc_attr( '40% OFF' ) . '', + '' . esc_attr( 'FLASH40' ) . '' + ) + ); + ?> +

+
+
+ diff --git a/languages/wc-min-max-quantities.pot b/languages/wc-min-max-quantities.pot index 306109e..d55fa02 100644 --- a/languages/wc-min-max-quantities.pot +++ b/languages/wc-min-max-quantities.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: WC Min Max Quantities 2.0.2\n" "Report-Msgid-Bugs-To: https://pluginever.com/support/\n" -"POT-Creation-Date: 2024-11-24 06:40:43+00:00\n" +"POT-Creation-Date: 2024-11-24 10:10:10+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -223,6 +223,36 @@ msgstr "" msgid "Documentation" msgstr "" +#: includes/Admin/views/notices/black-friday.php:19 +msgid "Black Friday & Cyber Monday: Flat 40% OFF All Premium Plugins!" +msgstr "" + +#: includes/Admin/views/notices/black-friday.php:26 +#. translators: 1.Offer Percentage, 2. Coupon Code. +msgid "" +"Customize your WooCommerce store, boost your sales with powerful features. " +"Don’t miss this limited-time deal! Get %1$s on all premium plugins with " +"code %2$s." +msgstr "" + +#: includes/Admin/views/notices/black-friday.php:39 +msgid "Claim your 40% discount!!" +msgstr "" + +#: includes/Admin/views/notices/black-friday.php:43 +#: includes/Admin/views/notices/halloween.php:43 +msgid "Remind me later" +msgstr "" + +#: includes/Admin/views/notices/black-friday.php:47 +#: includes/Admin/views/notices/halloween.php:51 +msgid "DISMISS" +msgstr "" + +#: includes/Admin/views/notices/black-friday.php:50 +msgid "Valid until November 7, 2024" +msgstr "" + #: includes/Admin/views/notices/halloween.php:19 msgid "Limited Time Offer! PluginEver Halloween Sale: 30% OFF!!" msgstr "" @@ -238,18 +268,10 @@ msgstr "" msgid "Claim your discount!!" msgstr "" -#: includes/Admin/views/notices/halloween.php:43 -msgid "Remind me later" -msgstr "" - #: includes/Admin/views/notices/halloween.php:47 msgid "Never show this again!" msgstr "" -#: includes/Admin/views/notices/halloween.php:51 -msgid "DISMISS" -msgstr "" - #: includes/Admin/views/notices/halloween.php:54 msgid "Valid until November 10, 2024" msgstr "" From 62d552af249e9a559e3e0e22ecb53a9fa93a7427 Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Sun, 24 Nov 2024 16:22:19 +0600 Subject: [PATCH 2/3] Update pot file --- languages/wc-min-max-quantities.pot | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/languages/wc-min-max-quantities.pot b/languages/wc-min-max-quantities.pot index d55fa02..9184708 100644 --- a/languages/wc-min-max-quantities.pot +++ b/languages/wc-min-max-quantities.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: WC Min Max Quantities 2.0.2\n" "Report-Msgid-Bugs-To: https://pluginever.com/support/\n" -"POT-Creation-Date: 2024-11-24 10:10:10+00:00\n" +"POT-Creation-Date: 2024-11-24 10:21:59+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -230,9 +230,8 @@ msgstr "" #: includes/Admin/views/notices/black-friday.php:26 #. translators: 1.Offer Percentage, 2. Coupon Code. msgid "" -"Customize your WooCommerce store, boost your sales with powerful features. " -"Don’t miss this limited-time deal! Get %1$s on all premium plugins with " -"code %2$s." +"Boost your WooCommerce store this Black Friday! Get %1$s on all premium " +"plugins with code %2$s. Don’t miss this limited-time deal!" msgstr "" #: includes/Admin/views/notices/black-friday.php:39 From 7d3eaadaf7de940a2ce69590cb07b9062c1abb8e Mon Sep 17 00:00:00 2001 From: kawsarahmedr Date: Sun, 24 Nov 2024 16:24:55 +0600 Subject: [PATCH 3/3] Update notice --- includes/Admin/Notices.php | 2 +- includes/Admin/views/notices/black-friday.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Admin/Notices.php b/includes/Admin/Notices.php index 724493b..6dc6761 100644 --- a/includes/Admin/Notices.php +++ b/includes/Admin/Notices.php @@ -38,7 +38,7 @@ public function admin_notices() { 'message' => __DIR__ . '/views/notices/black-friday.php', 'notice_id' => 'wcmmq_black_friday_promotion_24', 'class' => 'notice-black-friday', - 'style' => 'border-left-color: #2271b1;', + 'style' => 'border-left-color:#2271b1;', 'dismissible' => false, ) ); diff --git a/includes/Admin/views/notices/black-friday.php b/includes/Admin/views/notices/black-friday.php index 0849ff3..2190ae0 100644 --- a/includes/Admin/views/notices/black-friday.php +++ b/includes/Admin/views/notices/black-friday.php @@ -3,7 +3,7 @@ * Admin notice: Black Friday offer. * * @package WooCommerceMinMaxQuantities - * @since 2.0.2 + * @since 2.0.3 * @return void */