| @@ -18,16 +18,17 @@ | ||
| 18 | 18 | * |
| 19 | 19 | * @since 1.1.0 |
| 20 | 20 | */ |
| 21 | 21 | public function __construct() { |
| 22 | - if ( ! class_exists( 'Elementor\Plugin' ) ) { | |
| 23 | - return false; | |
| 22 | + if ( class_exists( 'Elementor\Plugin' ) ) { | |
| 23 | + sellkit()->load_files( [ | |
| 24 | + 'admin/funnel/importer/page-builders/elementor-importer', | |
| 25 | + ] ); | |
| 24 | 26 | } |
| 25 | 27 | |
| 26 | 28 | sellkit()->load_files( |
| 27 | 29 | [ |
| 28 | 30 | 'admin/funnel/importer/page-builders/importer-base', |
| 29 | - 'admin/funnel/importer/page-builders/elementor-importer', | |
| 30 | 31 | 'admin/funnel/importer/step-importer', |
| 31 | 32 | 'admin/funnel/importer/ajax-handler', |
| 32 | 33 | ] |
| 33 | 34 | ); |
| @@ -43,8 +44,12 @@ | ||
| 43 | 44 | public function get_product_data() { |
| 44 | 45 | check_ajax_referer( 'sellkit', 'nonce' ); |
| 45 | 46 | |
| 46 | 47 | $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT ); |
| 48 | + | |
| 49 | + if ( ! sellkit()->has_valid_dependencies() ) { | |
| 50 | + wp_send_json_error( __( 'Please install and activate WooCommerce.', 'sellkit' ) ); | |
| 51 | + } | |
| 47 | 52 | |
| 48 | 53 | $product = wc_get_product( $product_id ); |
| 49 | 54 | |
| 50 | 55 | if ( empty( $product ) ) { |