PluginProbe ʕ •ᴥ•ʔ
Conditional Logic for Woo Product Add-ons / 1.1.0
Conditional Logic for Woo Product Add-ons v1.1.0
trunk 1.0.0 1.1.0 1.2.0 1.2.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2.0 2.2.1 2.2.2 2.2.3
conditional-logic-for-woo-product-add-ons / src / Schema.php
conditional-logic-for-woo-product-add-ons / src Last commit date
Admin 3 years ago Core 3 years ago Frontend 3 years ago AddonsConditionsPlugin.php 3 years ago SanitizeManager.php 3 years ago Schema.php 3 years ago
Schema.php
164 lines
1 <?php namespace MeowCrew\AddonsConditions;
2
3 /**
4 * Class Schema
5 *
6 * @package MeowCrew\Schema
7 */
8 class Schema {
9
10 public static function getSupportedAddonTypes() {
11 /**
12 * Addon types that support conditions
13 *
14 * @since 1.0.0
15 **/
16 return apply_filters( 'product_addons_conditions/schema/supported_addon_types', array(
17 'multiple_choice',
18 'checkbox',
19 'custom_text',
20 'custom_textarea',
21 'custom_price',
22 'input_multiplier',
23 'file_upload',
24 'heading'
25 ) );
26 }
27
28 public static function getSupportedConditionsAddonTypes() {
29 /**
30 * Addon types that can be used in conditions
31 *
32 * @since 1.0.0
33 **/
34 return apply_filters( 'product_addons_conditions/schema/supported_conditions_addon_types', array(
35 'multiple_choice',
36 'checkbox',
37 'custom_text',
38 'custom_textarea',
39 'custom_price',
40 'input_multiplier',
41 'file_upload',
42 ) );
43 }
44
45 public static function getAddonSupportedRelations() {
46 /**
47 * Addons relations
48 *
49 * @since 1.0.0
50 **/
51 return apply_filters( 'product_addons_conditions/schema/addon_supported_relations', array(
52 'multiple_choice' => array( 'is', 'is_not' ),
53 'checkbox' => array( 'is', 'is_not' ),
54 'custom_text' => array(
55 'is',
56 'is_not',
57 'is_empty',
58 'is_not_empty',
59 'text_contains',
60 'text_end_with',
61 'text_start_with',
62 'text_does_not_contain'
63 ),
64 'custom_textarea' => array(
65 'is',
66 'is_not',
67 'is_empty',
68 'is_not_empty',
69 'text_contains',
70 'text_end_with',
71 'text_start_with',
72 'text_does_not_contain'
73 ),
74 'custom_price' => array(
75 'is',
76 'is_not',
77 'is_less_than',
78 'is_greater_than',
79 'is_less_than_or_equal',
80 'is_greater_than_or_equal'
81 ),
82 'input_multiplier' => array(
83 'is',
84 'is_not',
85 'is_less_than',
86 'is_greater_than',
87 'is_less_than_or_equal',
88 'is_greater_than_or_equal'
89 ),
90 'file_upload' => array( 'is', 'is_not' ),
91 'heading' => array(),
92 ) );
93 }
94
95 public static function getAvailableRelations() {
96 /**
97 * List of available relations
98 *
99 * @since 1.0.0
100 **/
101 return apply_filters( 'product_addons_conditions/schema/available_relations', array(
102 'is' => array(
103 'label' => __( 'Is', 'conditional-logic-for-product-addons' ),
104 'value_type' => 'text',
105 ),
106
107 'is_not' => array(
108 'label' => __( 'Is not', 'conditional-logic-for-product-addons' ),
109 'value_type' => 'text',
110 ),
111
112 'is_empty' => array(
113 'label' => __( 'Is empty', 'conditional-logic-for-product-addons' ),
114 'value_type' => 'none',
115 ),
116
117 'is_not_empty' => array(
118 'label' => __( 'Is not empty', 'conditional-logic-for-product-addons' ),
119 'value_type' => 'none',
120 ),
121
122 'is_greater_than' => array(
123 'label' => __( 'Is greater than', 'conditional-logic-for-product-addons' ),
124 'value_type' => 'number',
125 ),
126
127 'is_less_than' => array(
128 'label' => __( 'Is less than', 'conditional-logic-for-product-addons' ),
129 'value_type' => 'number',
130 ),
131
132 'is_greater_than_or_equal' => array(
133 'label' => __( 'Is greater than or equal', 'conditional-logic-for-product-addons' ),
134 'value_type' => 'number',
135 ),
136
137 'is_less_than_or_equal' => array(
138 'label' => __( 'Is less than or equal', 'conditional-logic-for-product-addons' ),
139 'value_type' => 'number',
140 ),
141
142 'text_contains' => array(
143 'label' => __( 'Text contains', 'conditional-logic-for-product-addons' ),
144 'value_type' => 'text',
145 ),
146
147 'text_does_not_contain' => array(
148 'label' => __( 'Text does not contain', 'conditional-logic-for-product-addons' ),
149 'value_type' => 'text',
150 ),
151
152 'text_start_with' => array(
153 'label' => __( 'Text starts with', 'conditional-logic-for-product-addons' ),
154 'value_type' => 'text',
155 ),
156
157 'text_end_with' => array(
158 'label' => __( 'Text end with', 'conditional-logic-for-product-addons' ),
159 'value_type' => 'text',
160 ),
161 ) );
162 }
163 }
164