| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: Sellkit |
| 4 | 4 | * Plugin URI: https://getsellkit.com/ |
| 5 | 5 | * Description: Build unlimited sales funnels, one-click order bumps and upsells, custom thank you pages, and more. The free version of SellKit also offers a huge round of features to optimize your WooCommerce store: build and style single or multi-step checkout pages with advanced styling options. Add, remove & reorder form fields. Fasten the form submission process with pre-populated form data, Instant form validation, and removing cart page. All this and more is 100% free and for an unlimited number of sites. |
| 6 | - * Version: 1.7.9 | |
| 6 | + * Version: 2.3.0 | |
| 7 | 7 | * Author: Artbees |
| 8 | 8 | * Author URI: https://artbees.net |
| 9 | 9 | * Text Domain: sellkit |
| 10 | 10 | * License: GPL2 |
| @@ -159,8 +159,10 @@ | ||
| 159 | 159 | |
| 160 | 160 | $this->load_files( [ |
| 161 | 161 | 'db', |
| 162 | 162 | 'functions', |
| 163 | + 'funnel/redirect', | |
| 164 | + 'funnel/homepage', | |
| 163 | 165 | 'funnel/analytics/data-updater', |
| 164 | 166 | 'global-checkout/class', |
| 165 | 167 | 'funnel/class', |
| 166 | 168 | 'funnel/contacts/base-contacts', |
| @@ -235,12 +237,24 @@ | ||
| 235 | 237 | * |
| 236 | 238 | * @since 1.1.0 |
| 237 | 239 | */ |
| 238 | 240 | public function plugins_loaded() { |
| 241 | + if ( 'elementor' === $this->page_builder() ) { | |
| 242 | + $this->load_files( [ | |
| 243 | + 'elementor/class', | |
| 244 | + ] ); | |
| 245 | + } | |
| 246 | + | |
| 239 | 247 | $this->load_files( [ |
| 240 | - 'elementor/class', | |
| 241 | 248 | 'admin/class-promote-sellkit-pro', |
| 242 | 249 | ] ); |
| 250 | + | |
| 251 | + if ( class_exists( 'WooCommerce' ) && 'gutenberg' === $this->page_builder() ) { | |
| 252 | + $this->load_files( [ | |
| 253 | + 'block-editor/helper', | |
| 254 | + 'block-editor/class', | |
| 255 | + ] ); | |
| 256 | + } | |
| 243 | 257 | } |
| 244 | 258 | |
| 245 | 259 | /** |
| 246 | 260 | * Do some stuff on plugin activation. |
| @@ -520,9 +534,34 @@ | ||
| 520 | 534 | 'removedContentBoxes' => Sellkit_Admin_Settings::get_removed_content_box(), |
| 521 | 535 | 'sellkitProIsActive' => $this->has_pro, |
| 522 | 536 | 'wcIsActivated' => $this->has_valid_dependencies(), |
| 523 | 537 | 'activeTheme' => wp_get_theme()->get( 'Name' ), |
| 538 | + 'pageBuilder' => $this->page_builder(), | |
| 524 | 539 | ]; |
| 540 | + } | |
| 541 | + | |
| 542 | + /** | |
| 543 | + * Get page builder. | |
| 544 | + * | |
| 545 | + * @since 2.3.0 | |
| 546 | + * @return string | |
| 547 | + */ | |
| 548 | + public function page_builder() { | |
| 549 | + $default = 'gutenberg'; | |
| 550 | + | |
| 551 | + if ( class_exists( 'Elementor\Plugin' ) ) { | |
| 552 | + $default = 'elementor'; | |
| 553 | + } | |
| 554 | + | |
| 555 | + $page_builder = sellkit_get_option( 'page_builder', '' ); | |
| 556 | + | |
| 557 | + if ( empty( $page_builder ) ) { | |
| 558 | + sellkit_update_option( 'page_builder', $default ); | |
| 559 | + | |
| 560 | + return $default; | |
| 561 | + } | |
| 562 | + | |
| 563 | + return $page_builder; | |
| 525 | 564 | } |
| 526 | 565 | |
| 527 | 566 | /** |
| 528 | 567 | * Get woocommerce settings data. |