← All changes
|
includes/core/widgets/elementor/class-manager.php
+17
-15
2.8.16
→
3.13.3
View file →
| @@ -238,8 +238,17 @@ | ||
| 238 | 238 | } else { |
| 239 | 239 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Order_Details()); |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | + | |
| 243 | + // Register Offer Button only if Pro is not active | |
| 244 | + if( ( $step_type == 'upsell' || $step_type == 'downsell' ) && ! Wpfnl_functions::is_wpfnl_pro_activated() ) { | |
| 245 | + if ( version_compare(ELEMENTOR_VERSION, '3.5.0', '>=') ) { | |
| 246 | + \Elementor\Plugin::instance()->widgets_manager->register( new Offer_Button() ); | |
| 247 | + } else { | |
| 248 | + \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Offer_Button()); | |
| 249 | + } | |
| 250 | + } | |
| 242 | 251 | } |
| 243 | 252 | |
| 244 | 253 | } |
| 245 | 254 | }elseif(wp_get_theme()->get('Name') == 'Woodmart'){ |
| @@ -247,8 +256,12 @@ | ||
| 247 | 256 | \Elementor\Plugin::instance()->widgets_manager->register(new Step_Pointer()); |
| 248 | 257 | \Elementor\Plugin::instance()->widgets_manager->register(new OptinForm()); |
| 249 | 258 | \Elementor\Plugin::instance()->widgets_manager->register(new Checkout_Form()); |
| 250 | 259 | \Elementor\Plugin::instance()->widgets_manager->register(new Order_Details()); |
| 260 | + // Register Offer Button only if Pro is not active | |
| 261 | + if ( ! Wpfnl_functions::is_wpfnl_pro_activated() ) { | |
| 262 | + \Elementor\Plugin::instance()->widgets_manager->register(new Offer_Button()); | |
| 263 | + } | |
| 251 | 264 | } else { |
| 252 | 265 | // for older version of elementor |
| 253 | 266 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Step_Pointer()); |
| 254 | 267 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new OptinForm()); |
| @@ -253,8 +266,12 @@ | ||
| 253 | 266 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Step_Pointer()); |
| 254 | 267 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new OptinForm()); |
| 255 | 268 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Checkout_Form()); |
| 256 | 269 | \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Order_Details()); |
| 270 | + // Register Offer Button only if Pro is not active | |
| 271 | + if ( ! Wpfnl_functions::is_wpfnl_pro_activated() ) { | |
| 272 | + \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Offer_Button()); | |
| 273 | + } | |
| 257 | 274 | } |
| 258 | 275 | } |
| 259 | 276 | |
| 260 | 277 | } |
| @@ -279,14 +296,8 @@ | ||
| 279 | 296 | } |
| 280 | 297 | if( !$step_id && isset($_POST['initial_document_id'] ) ) { |
| 281 | 298 | $step_id = $_POST['initial_document_id']; |
| 282 | 299 | } |
| 283 | - if( $step_id ){ | |
| 284 | - $cookie_name = 'wpfunnels_current_step_id'; | |
| 285 | - $cookie = isset( $_COOKIE[$cookie_name] ) ? json_decode( wp_unslash( $_COOKIE[$cookie_name] ), true ) : $step_id; | |
| 286 | - setcookie( $cookie_name, $cookie, time() + 3600 * 6, '/', COOKIE_DOMAIN ); | |
| 287 | - } | |
| 288 | - | |
| 289 | 300 | }else { |
| 290 | 301 | $step_id = isset($_GET['post']) ? $_GET['post'] : get_the_ID(); |
| 291 | 302 | } |
| 292 | 303 | |
| @@ -299,17 +310,8 @@ | ||
| 299 | 310 | if( !empty($_COOKIE['wpfunnels_current_post_id']) ){ |
| 300 | 311 | $step_id = $_COOKIE['wpfunnels_current_post_id']; |
| 301 | 312 | } |
| 302 | 313 | } |
| 303 | - } | |
| 304 | - } | |
| 305 | - | |
| 306 | - if( !$step_id ){ | |
| 307 | - $cookie_name = 'wpfunnels_current_step_id'; | |
| 308 | - $cookie = isset( $_COOKIE[$cookie_name] ) ? json_decode( wp_unslash( $_COOKIE[$cookie_name] ), true ) : ''; | |
| 309 | - if( $cookie ){ | |
| 310 | - $step_id = $cookie; | |
| 311 | - setcookie( $cookie_name, null, strtotime( '-1 days' ), '/', COOKIE_DOMAIN ); | |
| 312 | 314 | } |
| 313 | 315 | } |
| 314 | 316 | |
| 315 | 317 | return $step_id; |