PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 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 All 261 releases
← All changes | includes/core/compatibility/plugin/class-wpfnl-elementor-pro.php +66 -0 3.11.1 → 3.13.3 View file →
@@ -25,8 +25,74 @@
25 25 * @since 3.4.9
26 26 */
27 27 public function init() {
28 28 add_action( 'elementor_pro/forms/new_record', array( $this, 'after_submit_elementor_form'), 10,2 );
29 + // Priority 0: fires before initialize_cart_data (priority 10) so the hooks are gone before add_to_cart.
30 + add_action( 'wp', [ $this, 'remove_elementor_wc_hooks_on_funnel_checkout' ], 0 );
31 + // Priority -2: fires before Elementor Pro's hook (priority 10) during update_order_review AJAX.
32 + add_action( 'woocommerce_checkout_update_order_review', [ $this, 'remove_elementor_wc_hooks_on_funnel_checkout_ajax' ], -2 );
33 + }
34 +
35 +
36 + /**
37 + * Get Elementor Pro's WooCommerce module instance.
38 + *
39 + * @return object|null
40 + */
41 + private function get_elementor_wc_module() {
42 + if ( ! class_exists( '\ElementorPro\Plugin' ) ) {
43 + return null;
44 + }
45 + return \ElementorPro\Plugin::instance()->modules_manager->get_modules( 'woocommerce' );
46 + }
47 +
48 +
49 + /**
50 + * Remove Elementor Pro's WooCommerce hooks on WPFunnels checkout page load.
51 + *
52 + * Elementor Pro's load_widget_before_wc_ajax() calls create_element_instance() which returns
53 + * null in non-AJAX contexts, causing a fatal TypeError. Remove both hooks it registers so
54 + * neither woocommerce_before_calculate_totals nor woocommerce_checkout_update_order_review
55 + * trigger it during WPFunnels cart initialization.
56 + *
57 + * @since 3.11.1
58 + */
59 + public function remove_elementor_wc_hooks_on_funnel_checkout() {
60 + if ( ! Wpfnl_functions::check_if_this_is_step_type( 'checkout' ) ) {
61 + return;
62 + }
63 +
64 + $wc_module = $this->get_elementor_wc_module();
65 + if ( ! $wc_module ) {
66 + return;
67 + }
68 +
69 + remove_action( 'woocommerce_before_calculate_totals', [ $wc_module, 'load_widget_before_wc_ajax' ] );
70 + remove_action( 'woocommerce_checkout_update_order_review', [ $wc_module, 'load_widget_before_wc_ajax' ] );
71 + }
72 +
73 +
74 + /**
75 + * Remove Elementor Pro's woocommerce_checkout_update_order_review hook during WPFunnels AJAX.
76 + *
77 + * Runs at priority -2 on woocommerce_checkout_update_order_review so it fires before
78 + * Elementor Pro's hook (priority 10) during the WC update_order_review AJAX request.
79 + *
80 + * @since 3.11.1
81 + */
82 + public function remove_elementor_wc_hooks_on_funnel_checkout_ajax() {
83 + $page_data = Wpfnl_functions::is_funnel_checkout_page();
84 + if ( empty( $page_data['status'] ) ) {
85 + return;
86 + }
87 +
88 + $wc_module = $this->get_elementor_wc_module();
89 + if ( ! $wc_module ) {
90 + return;
91 + }
92 +
93 + remove_action( 'woocommerce_checkout_update_order_review', [ $wc_module, 'load_widget_before_wc_ajax' ] );
94 + remove_action( 'woocommerce_before_calculate_totals', [ $wc_module, 'load_widget_before_wc_ajax' ] );
29 95 }
30 96
31 97
32 98 /**