| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Classes\Notifications; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Classes\Notifications\Base\User_Data; |
| 6 |
use WPAdminify\Inc\Classes\Notifications\Model\Notice; |
| 7 |
|
| 8 |
|
| 9 |
if (!class_exists('Discount')) { |
| 10 |
/** |
| 11 |
* Discount Class |
| 12 |
* |
| 13 |
* Jewel Theme <support@jeweltheme.com> |
| 14 |
*/ |
| 15 |
class Discount extends Notice |
| 16 |
{ |
| 17 |
|
| 18 |
use User_Data; |
| 19 |
|
| 20 |
public $color = 'none'; |
| 21 |
public $coupon_code = 'LITEFLASH25'; |
| 22 |
|
| 23 |
/** |
| 24 |
* Construct method |
| 25 |
* |
| 26 |
* @author Jewel Theme <support@jeweltheme.com> |
| 27 |
*/ |
| 28 |
public function __construct() |
| 29 |
{ |
| 30 |
parent::__construct(); |
| 31 |
|
| 32 |
if (empty(get_option('wpadminify_notice_discount_code'))) { |
| 33 |
update_option('wpadminify_notice_discount_code', $this->coupon_code); |
| 34 |
} |
| 35 |
add_action('admin_enqueue_scripts', [$this, 'discount_coupon_scripts'], 999); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Notice Content |
| 40 |
* |
| 41 |
* @author Jewel Theme <support@jeweltheme.com> |
| 42 |
*/ |
| 43 |
public function notice_content() |
| 44 |
{ ?> |
| 45 |
<div class="wp-adminify-discount-coupons-wrapper notice notice-jltma is-dismissible notice-plugin-discount notice-<?php echo esc_attr($this->color); ?> wp-adminify-notice-<?php echo esc_attr($this->get_id()); ?>"> |
| 46 |
|
| 47 |
<div class="wp-adminify-subscribe-content"> |
| 48 |
<h2> |
| 49 |
Notice Content, Coupon Code: <?php echo esc_attr($this->coupon_code); ?> |
| 50 |
</h2> |
| 51 |
<h2> |
| 52 |
<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 53 |
<path d="M5.5 1L0.5 7H5L4.5 11L9.5 5H5L5.5 1Z" stroke="#D92D20" stroke-linecap="round" stroke-linejoin="round" /> |
| 54 |
</svg> |
| 55 |
Flash Sale |
| 56 |
</h2> |
| 57 |
<h3>Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content Notice Content </h3> |
| 58 |
<img width="70" height="70" src="<?php echo esc_url(WP_ADMINIFY_ASSETS_IMAGE . 'promo-image.png'); ?>" alt="<?php esc_attr_e('20% Discount Coupon', 'adminify'); ?>"> |
| 59 |
</div> |
| 60 |
</div> |
| 61 |
<?php |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
public function discount_coupon_scripts() |
| 66 |
{ |
| 67 |
$discount_css = ''; |
| 68 |
$discount_css .= '.wp-adminify-discount-coupons-wrapper.notice-jltma{ |
| 69 |
adding: 0 !important; |
| 70 |
border: 0; |
| 71 |
}'; |
| 72 |
$discount_css .= '.wp-adminify-admin #wpbody-content .notice-jltma{ |
| 73 |
adding: 0 !important; |
| 74 |
border: 0; |
| 75 |
background-image: url("") |
| 76 |
}'; |
| 77 |
// $discount_css .= '.wp-adminify-discount-coupons-wrapper .wp-adminify-subscribe-content{ |
| 78 |
// background: red; |
| 79 |
// }'; |
| 80 |
|
| 81 |
wp_add_inline_style('master-addons-admin-sdk', $discount_css); |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
/** |
| 87 |
* Intervals |
| 88 |
* |
| 89 |
* @author Jewel Theme <support@jeweltheme.com> |
| 90 |
*/ |
| 91 |
public function intervals() |
| 92 |
{ |
| 93 |
return array(5, 4, 10, 20, 15, 25, 30, 45, 15, 30, 10, 6); |
| 94 |
} |
| 95 |
} |
| 96 |
} |
| 97 |
|