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.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 / cart-item.php

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

94 lines 1.5 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\Conditions\Condition_Base;
6 use Sellkit\Contact_Segmentation\Contact_Data;
7
8 defined( 'ABSPATH' ) || die();
9
10 /**
11 * Class Cart Item.
12 *
13 * @package Sellkit\Contact_Segmentation\Conditions
14 * @since 1.1.0
15 */
16 class Cart_Item extends Condition_Base {
17
18 /**
19 * Condition name.
20 *
21 * @since 1.1.0
22 */
23 public function get_name() {
24 return 'cart-item';
25 }
26
27 /**
28 * Condition title.
29 *
30 * @since 1.1.0
31 */
32 public function get_title() {
33 return __( 'Cart Items', 'sellkit' );
34 }
35
36 /**
37 * Condition type.
38 *
39 * @since 1.1.0
40 */
41 public function get_type() {
42 return self::SELLKIT_MULTISELECT_CONDITION_VALUE;
43 }
44
45 /**
46 * Gets value.
47 *
48 * @since 1.1.0
49 */
50 public function get_value() {
51
52 if ( ! class_exists( 'Contact_Data' ) ) {
53 require_once __DIR__ . '/../contact-data.php';
54 }
55
56 return Contact_Data::get_cart_items();
57 }
58
59 /**
60 * Get the options
61 *
62 * @since 1.1.0
63 * @return array
64 */
65 public function get_options() {
66 if ( ! sellkit()->has_valid_dependencies() ) {
67 return [];
68 }
69
70 $input_value = sellkit_htmlspecialchars( INPUT_GET, 'input_value' );
71
72 return sellkit_get_products( sanitize_text_field( $input_value ) );
73 }
74
75 /**
76 * It is pro feature or not.
77 *
78 * @since 1.1.0
79 */
80 public function is_pro() {
81 return true;
82 }
83
84 /**
85 * All the conditions are not searchable by default.
86 *
87 * @return false
88 * @since 1.1.0
89 */
90 public function is_searchable() {
91 return true;
92 }
93 }
94