PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.2.5
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.2.5
2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 All 43 releases
sellkit / includes / contact-segmentation / conditions / condition-base.php

condition-base.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.2.5, at includes/contact-segmentation/conditions/condition-base.php

105 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 Sellkit\Contact_Segmentation\Conditions;
4
5 use Sellkit\Contact_Segmentation\Contact_Data;
6
7 defined( 'ABSPATH' ) || die();
8
9 /**
10 * Class Condition_Base.
11 *
12 * @package Sellkit\Contact_Segmentation\Base.
13 * @since 1.1.0
14 * @SuppressWarnings(PHPMD.NumberOfChildren)
15 */
16 abstract class Condition_Base {
17
18 const SELLKIT_DROP_DOWN_CONDITION_VALUE = 'drop-down';
19 const SELLKIT_TEXT_CONDITION_VALUE = 'text';
20 const SELLKIT_NUMBER_CONDITION_VALUE = 'number';
21 const SELLKIT_MULTISELECT_CONDITION_VALUE = 'multi-select';
22
23 /**
24 * Main contact data.
25 *
26 * @var Contact_Data
27 * @since 1.1.0
28 */
29 public $data;
30
31 /**
32 * Cart_Category constructor.
33 *
34 * @since 1.1.0
35 */
36 public function __construct() {
37 $contact_data = Contact_Data::get_instance();
38
39 $this->data = $contact_data->get_data();
40 }
41
42 /**
43 * Get title.
44 *
45 * @since 1.1.0
46 * @return string
47 */
48 abstract public function get_title();
49
50 /**
51 * Get name.
52 *
53 * @since 1.1.0
54 * @return string
55 */
56 abstract public function get_name();
57
58 /**
59 * Get type.
60 *
61 * @since 1.1.0
62 * @return string
63 */
64 abstract public function get_type();
65
66 /**
67 * Get value.
68 *
69 * @since 1.1.0
70 */
71 public function get_value() {
72 if ( empty( $this->data[ str_replace( '-', '_', $this->get_name() ) ] ) ) {
73 return '';
74 }
75
76 return $this->data[ str_replace( '-', '_', $this->get_name() ) ];
77 }
78
79 /**
80 * It is pro or not.
81 *
82 * @since 1.1.0
83 */
84 abstract public function is_pro();
85
86 /**
87 * All the conditions are not searchable by default.
88 *
89 * @return false
90 * @since 1.1.0
91 */
92 public function is_searchable() {
93 return false;
94 }
95
96 /**
97 * Check if the condition is active or not, Conditions are active by default.
98 *
99 * @return bool
100 */
101 public function is_active() {
102 return true;
103 }
104 }
105