PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.1
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / includes / core / compatibility / plugin / class-wpfnl-product-addon.php

class-wpfnl-product-addon.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at includes/core/compatibility/plugin/class-wpfnl-product-addon.php

61 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Product addon Compatibility
5 *
6 * @package WPFunnels\Compatibility\Plugin
7 */
8
9 namespace WPFunnels\Compatibility\Plugin;
10
11 use WPFunnels\Wpfnl_functions;
12 use WPFunnels\Traits\SingletonTrait;
13
14 /**
15 * Product addon Compatibility
16 *
17 * @package WPFunnels\Compatibility\Plugin
18 */
19 class ProductAddon extends PluginCompatibility{
20 use SingletonTrait;
21
22 /**
23 * Initiate Filters/Hook
24 *
25 * @since 3.3.2
26 */
27 public function init() {
28 add_filter('wpfunnels/allow_initiate_funnel_checkout', array($this, 'allow_initiate_funnel_checkout'), 10, 2 );
29 }
30
31
32 /**
33 * Determines whether to allow initiating the funnel checkout.
34 *
35 * @param bool $allow Whether to allow initiating the funnel checkout.
36 * @param int $funnel_id The ID of the funnel.
37 * @return bool Whether to allow initiating the funnel checkout.
38 *
39 * @since 3.3.2
40 */
41 public function allow_initiate_funnel_checkout($allow, $funnel_id ){
42 $is_gbf = get_post_meta( $funnel_id, 'is_global_funnel', true );
43 if( 'yes' === $is_gbf ){
44 $allow = false;
45 }
46 return $allow;
47 }
48
49
50 /**
51 * Check if Product addon is activated
52 *
53 * @return bool
54 * @since 3.3.2
55 */
56 public function maybe_activate()
57 {
58 return defined('WCPA_VERSION');
59 }
60 }
61