PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
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 2.7.0, at includes/contact-segmentation/conditions/condition-base.php

109 lines 1.9 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 const SELLKIT_REACT_SELECT_CONDITION_VALUE = 'react-select';
23
24 /**
25 * Main contact data.
26 *
27 * @var Contact_Data
28 * @since 1.1.0
29 */
30 public $data;
31
32 /**
33 * Cart_Category constructor.
34 *
35 * @since 1.1.0
36 */
37 public function __construct() {
38 if ( ! class_exists( 'Contact_Data' ) ) {
39 require_once __DIR__ . '/../contact-data.php';
40 }
41 $contact_data = Contact_Data::get_instance();
42
43 $this->data = $contact_data->get_data();
44 }
45
46 /**
47 * Get title.
48 *
49 * @since 1.1.0
50 * @return string
51 */
52 abstract public function get_title();
53
54 /**
55 * Get name.
56 *
57 * @since 1.1.0
58 * @return string
59 */
60 abstract public function get_name();
61
62 /**
63 * Get type.
64 *
65 * @since 1.1.0
66 * @return string
67 */
68 abstract public function get_type();
69
70 /**
71 * Get value.
72 *
73 * @since 1.1.0
74 */
75 public function get_value() {
76 if ( empty( $this->data[ str_replace( '-', '_', $this->get_name() ) ] ) ) {
77 return '';
78 }
79
80 return $this->data[ str_replace( '-', '_', $this->get_name() ) ];
81 }
82
83 /**
84 * It is pro or not.
85 *
86 * @since 1.1.0
87 */
88 abstract public function is_pro();
89
90 /**
91 * All the conditions are not searchable by default.
92 *
93 * @return false
94 * @since 1.1.0
95 */
96 public function is_searchable() {
97 return false;
98 }
99
100 /**
101 * Check if the condition is active or not, Conditions are active by default.
102 *
103 * @return bool
104 */
105 public function is_active() {
106 return true;
107 }
108 }
109