PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.0
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.0
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / Extensions / EDD / EDInline.php

EDInline.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.3.0, at includes/Extensions/EDD/EDInline.php

119 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * EDD Extension
5 *
6 * @package NotificationX\Extensions
7 */
8
9 namespace NotificationX\Extensions\EDD;
10
11 /**
12 * EDD Extension
13 */
14 class EDDInline extends EDD {
15 protected static $instance = null;
16
17 public $priority = 10;
18 public $id = 'edd_inline';
19 public $img = NOTIFICATIONX_ADMIN_URL . 'images/extensions/sources/edd.png';
20 public $doc_link = 'https://notificationx.com/docs/notificationx-easy-digital-downloads/';
21 public $types = 'inline';
22 public $module = 'modules_edd';
23 public $module_priority = 5;
24 public $class = 'Easy_Digital_Downloads';
25 public $is_pro = true;
26
27 /**
28 * Initially Invoked when initialized.
29 */
30 public function __construct() {
31 add_filter( 'nx_show_on_exclude', array( $this, 'show_on_exclude' ), 10, 4 );
32 parent::__construct();
33 }
34
35 public function init_extension()
36 {
37 $this->themes = [
38 'conv-theme-seven' => array(
39 'is_pro' => true,
40 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/pro/woo-inline.jpg',
41 'image_shape' => 'rounded',
42 'inline_location' => ['edd_single'],
43 'template' => [
44 'first_param' => 'tag_sales_count',
45 'custom_first_param' => __( 'Someone', 'notificationx' ),
46 'second_param' => __( 'people purchased', 'notificationx' ),
47 'third_param' => 'tag_custom',
48 'custom_third_param' => ' ',
49 'fourth_param' => 'tag_7days',
50 'custom_fourth_param' => __( 'in last {{day:7}}', 'notificationx' ),
51 ],
52 ),
53 ];
54 $this->templates = [
55 'woo_template_sales_count' => [
56 'first_param' => [
57 'tag_sales_count' => __( 'Sales Count', 'notificationx' ),
58 ],
59 'third_param' => [
60 'tag_product_title' => __( 'Product Title', 'notificationx' ),
61 ],
62 'fourth_param' => [
63 'tag_1day' => __( 'In last 1 day', 'notificationx' ),
64 'tag_7days' => __( 'In last 7 days', 'notificationx' ),
65 'tag_30days' => __( 'In last 30 days', 'notificationx' ),
66 ],
67 '_themes' => [
68 "{$this->id}_conv-theme-seven",
69 ],
70 ],
71 ];
72 }
73
74 /**
75 * @todo Something
76 *
77 * @param [type] $exclude
78 * @param [type] $settings
79 * @return void
80 */
81 public function show_on_exclude( $exclude, $settings ) {
82 if ( 'inline' === $settings['type'] && $settings['source'] === $this->id ) {
83 $edd_location = $settings['inline_location'];
84 $hooks = [ 'edd_archive', 'edd_single' ];
85 $diff = array_diff( $hooks, $edd_location );
86 if ( count( $diff ) <= count( $hooks ) ) {
87 return true;
88 }
89 }
90 return $exclude;
91 }
92 /**
93 * Get the instance of called class.
94 *
95 * @return ReviewX
96 */
97 public static function get_instance($args = null){
98 if ( is_null( static::$instance ) ) {
99 $class = __CLASS__;
100 if(strpos($class, "NotificationX\\") === 0){
101 $pro_class = str_replace("NotificationX\\", "NotificationXPro\\", $class);
102 if(class_exists($pro_class)){
103 $class = $pro_class;
104 }
105 }
106
107 if(!empty($args)){
108 static::$instance = new $class($args);
109 }
110 else{
111 static::$instance = new $class;
112 }
113 }
114 return static::$instance;
115 }
116
117
118 }
119