PluginProbe
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 1.4.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v1.4.0
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 All 85 releases
shopengine / base / widget.php
widget.php
79 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ShopEngine\Base;
4
5 defined('ABSPATH') || exit;
6
7 use ShopEngine\Widgets\Products;
8 use ShopEngine\Utils\Controls_Helper;
9 use ShopEngine\Core\Elementor_Controls\Controls_Manager as ShopEngine_Controls_Manager;
10
11
12 abstract class Widget extends \Elementor\Widget_Base {
13
14 abstract public function config();
15
16 abstract protected function screen();
17
18 public function get_help_url() {
19 return 'https://wpmet.com/knowledgebase/shopengine/?ref__widget=' . $this->config()->get_name();
20 }
21
22 public function show_in_panel() {
23
24 $territory = $this->config()->get_template_territory();
25
26 if(empty($territory)) {
27 return true;
28 }
29
30 $current_template_id = (int)((isset($_GET['action']) && $_GET['action'] = 'elementor' && !empty($_GET['post']) ) ? $_GET['post'] : get_the_ID());
31
32 $current_template = Products::instance()->get_template_type_by_id($current_template_id);
33
34 return in_array($current_template, $territory);
35 }
36
37 public function shopengine_widget_before_render() {
38 //todo - remove shopengine later
39
40 echo '<div class="shopengine shopengine-widget">';
41 }
42
43 public function shopengine_widget_after_render() {
44 echo '</div>';
45 }
46
47 public function render() {
48 if(\ShopEngine\Widgets\Products::instance()->get_a_simple_product_id() === false) {
49 echo \ShopEngine\Widgets\Products::instance()->no_product_to_preview();
50
51 return;
52 }
53
54 $this->shopengine_widget_before_render();
55 $this->screen();
56 $this->shopengine_widget_after_render();
57 }
58
59 public function get_name() {
60 return 'shopengine-' . $this->config()->get_name();
61 }
62
63 public function get_title() {
64 return $this->config()->get_title();
65 }
66
67 public function get_icon() {
68 return $this->config()->get_icon();
69 }
70
71 public function get_categories() {
72 return $this->config()->get_categories();
73 }
74
75 public function get_keywords() {
76 return $this->config()->get_keywords();
77 }
78 }
79