PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
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 1.8.1 All 42 releases
sellkit / includes / contact-segmentation / operators / threshold-range.php

threshold-range.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/contact-segmentation/operators/threshold-range.php

64 lines 1.1 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\Operators;
4
5 use Sellkit\Contact_Segmentation\Operator_Base;
6
7 defined( 'ABSPATH' ) || die();
8
9 /**
10 * Class Threshold Range.
11 *
12 * @package Sellkit\Contact_Segmentation\Conditions
13 * @since 1.1.0
14 */
15 class Threshold_Range extends Operator_Base {
16
17 /**
18 * Condition name.
19 *
20 * @since 1.1.0
21 */
22 public function get_name() {
23 return 'threshold-range';
24 }
25
26 /**
27 * Condition title.
28 *
29 * @since 1.1.0
30 */
31 public function get_title() {
32 return esc_html__( 'threshold range', 'sellkit' );
33 }
34
35 /**
36 * Condition title.
37 *
38 * @since 1.1.0
39 */
40 public function get_conditions() {
41 return [
42 'cart-subtotal',
43 ];
44 }
45
46 /**
47 * Condition title.
48 *
49 * @since 1.1.0
50 * @param mixed $value The value of current value.
51 * @param mixed $condition_value The value of condition input.
52 */
53 public function is_valid( $value, $condition_value ) {
54 $threshold_range = $condition_value['threshold_range'];
55 $target_subtotal_amount = $condition_value['target_subtotal_amount'];
56
57 if ( $value > $threshold_range && $value < $target_subtotal_amount ) {
58 return true;
59 }
60
61 return false;
62 }
63 }
64