PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.3
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.3
3.3.3 3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 158 releases
notificationx / includes / Extensions / WooCommerce / WooCommerceCartPeek.php

WooCommerceCartPeek.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.3.3, at includes/Extensions/WooCommerce/WooCommerceCartPeek.php

86 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WooCommerce Cart Peek Extension (Free stub).
4 *
5 * The Free plugin registers the Cart Peek source so the Add New modal can
6 * render it as a locked / Pro-badged card. All behaviour lives in the Pro
7 * override at `NotificationXPro\Extensions\WooCommerce\WooCommerceCartPeek`;
8 * see WooCommerceSales.php for the same namespace-swap pattern.
9 *
10 * @package NotificationX\Extensions
11 */
12
13 namespace NotificationX\Extensions\WooCommerce;
14
15 /**
16 * WooCommerce Cart Peek Extension Class
17 * @method static WooCommerceCartPeek get_instance($args = null)
18 */
19 class WooCommerceCartPeek extends WooCommerce {
20 /**
21 * Instance of WooCommerceCartPeek
22 *
23 * @var WooCommerceCartPeek
24 */
25 protected static $instance = null;
26 public $priority = 6;
27 public $id = 'woocommerce_cart_peek';
28 public $img = NOTIFICATIONX_ADMIN_URL . 'images/extensions/sources/woocommerce.png';
29 public $doc_link = 'https://notificationx.com/docs/how-to-create-a-cart-peek-notification/';
30 public $types = 'woocommerce_cart_peek';
31 public $module = 'modules_woocommerce';
32 public $module_priority = 3;
33 public $class = '\WooCommerce';
34 public $default_theme = 'woocommerce_cart_peek_conv-theme-fourteen';
35 public $is_pro = true;
36
37 /**
38 * Get the instance of called class.
39 *
40 * @return WooCommerceCartPeek
41 */
42 public static function get_instance($args = null) {
43 if ( is_null( static::$instance ) || ! static::$instance instanceof self ) {
44 $class = __CLASS__;
45 if ( strpos( $class, 'NotificationX\\' ) === 0 ) {
46 $pro_class = str_replace( 'NotificationX\\', 'NotificationXPro\\', $class );
47 if ( class_exists( $pro_class ) ) {
48 $class = $pro_class;
49 }
50 }
51
52 if ( ! empty( $args ) ) {
53 static::$instance = new $class( $args );
54 } else {
55 static::$instance = new $class;
56 }
57 }
58 return static::$instance;
59 }
60
61 /**
62 * Initially Invoked when initialized.
63 */
64 public function __construct() {
65 parent::__construct();
66 }
67
68 public function init_extension() {
69 // The source is the WooCommerce store (shown with the WooCommerce icon in
70 // the Source tab); the "Cart Peek" identity lives on the notification type.
71 $this->title = __( 'WooCommerce', 'notificationx' );
72 $this->module_title = __( 'Cart Peek', 'notificationx' );
73 }
74
75 public function doc() {
76 /* translators: %1$s: WooCommerce install link, %2$s: Cart Peek documentation link */
77 return sprintf(
78 __( '<p>Show shoppers how many others have this product in their cart right now — a live social-proof signal that fires at the highest-value hesitation moment on the PDP.</p>
79 <p>Requires an active NotificationX Pro licence and <a target="_blank" href="%1$s">WooCommerce installed &amp; activated</a>.</p>
80 <p>📚 <a target="_blank" href="%2$s">Documentation</a></p>', 'notificationx' ),
81 'https://wordpress.org/plugins/woocommerce/',
82 'https://notificationx.com/docs/how-to-create-a-cart-peek-notification/'
83 );
84 }
85 }
86