PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.2.3
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.2.3
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / admin / funnel / class.php

class.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.2.3, at includes/admin/funnel/class.php

62 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Admin\Funnel;
4
5 defined( 'ABSPATH' ) || die();
6
7 /**
8 * Class Funnel.
9 *
10 * @since 1.1.0
11 */
12 class Funnel {
13
14 const SELLKIT_FUNNELS_TEMPLATE_SOURCE = 'https://templates.getsellkit.com';
15
16 /**
17 * Funnel_Importer constructor.
18 *
19 * @since 1.1.0
20 */
21 public function __construct() {
22 if ( ! class_exists( 'Elementor\Plugin' ) ) {
23 return false;
24 }
25
26 sellkit()->load_files(
27 [
28 'admin/funnel/importer/page-builders/importer-base',
29 'admin/funnel/importer/page-builders/elementor-importer',
30 'admin/funnel/importer/step-importer',
31 'admin/funnel/importer/ajax-handler',
32 ]
33 );
34
35 add_action( 'wp_ajax_sellkit_steps_bump_get_product_data', [ $this, 'get_product_data' ] );
36 }
37
38 /**
39 * Gets products data.
40 *
41 * @since 1.1.0
42 */
43 public function get_product_data() {
44 check_ajax_referer( 'sellkit', 'nonce' );
45
46 $product_id = filter_input( INPUT_GET, 'product_id', FILTER_SANITIZE_NUMBER_INT );
47
48 $product = wc_get_product( $product_id );
49
50 if ( empty( $product ) ) {
51 wp_send_json_error( __( 'Product does not exist', 'sellkit' ) );
52 }
53
54 wp_send_json_success( [
55 'thumbnail' => get_the_post_thumbnail_url( $product_id ),
56 'regularPrice' => $product->get_regular_price(),
57 ] );
58 }
59 }
60
61 new Funnel();
62