PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 4.9.3
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v4.9.3
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 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / init / enqueue-scripts.php
shopengine / widgets / init Last commit date
assets 3 weeks ago enqueue-scripts.php 1 year ago route.php 3 weeks ago
enqueue-scripts.php
61 lines
1 <?php
2
3 namespace ShopEngine\Widgets\Init;
4
5 defined('ABSPATH') || exit;
6
7 class Enqueue_Scripts
8 {
9
10 public function __construct() {
11
12 add_action('wp_enqueue_scripts', [$this, 'frontend_js']);
13 add_action('wp_enqueue_scripts', [$this, 'frontend_css'], 8);
14 add_action('elementor/editor/before_enqueue_scripts', [$this, 'editor_js']);
15 add_action('elementor/frontend/before_enqueue_scripts', [$this, 'elementor_js']);
16 add_action('elementor/editor/after_enqueue_styles', [$this, 'elementor_css']);
17 }
18
19 public function editor_js(){
20 if(get_post_type() != 'shopengine-template'){
21 return;
22 }
23
24 wp_enqueue_script('shopengine-editor-script', \ShopEngine::widget_url() . 'init/assets/js/editor.js', ['jquery', 'elementor-editor'], \ShopEngine::version(), true);
25 }
26
27 public function elementor_js() {
28 // Font Awesome fallback support on Editor Mode.
29 if ( defined( 'ELEMENTOR_ASSETS_URL' ) && \Elementor\Plugin::$instance->preview->is_preview_mode() ) {
30 wp_enqueue_style( 'editor-font-awesome', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.css', [], \ShopEngine::version() );
31 }
32
33
34 wp_enqueue_script('shopengine-elementor-script', \ShopEngine::widget_url() . 'init/assets/js/widgets.js', ['jquery', 'elementor-frontend'], \ShopEngine::version(), true);
35
36 // For Archive product widget Tooltip text translation support.
37 wp_localize_script('shopengine-elementor-script', 'shopengineLoopProductConfig', [
38 'add_to_cart' => __('Add to Cart', 'shopengine'),
39 'quick_view' => __('Quick View', 'shopengine'),
40 'add_to_wishlist' => __('Add to Wishlist', 'shopengine'),
41 'compare' => __('Compare', 'shopengine'),
42 'direct_checkout' => __('Direct Checkout', 'shopengine'),
43 ]);
44 }
45
46 public function elementor_css() {
47 wp_enqueue_style('shopengine-elementor-style', \ShopEngine::widget_url() . 'init/assets/css/widgets.css', null , \ShopEngine::version());
48 }
49
50 public function frontend_js() {
51 wp_register_script('asrange-js', \ShopEngine::widget_url() . 'init/assets/js/jquery-asRange.min.js', [], \ShopEngine::version(), true);
52 }
53
54 public function frontend_css() {
55 wp_enqueue_style('shopengine-widget-frontend', \ShopEngine::widget_url() . 'init/assets/css/widget-frontend.css', ['shopengine-public'], \ShopEngine::version());
56 if ( defined( 'ELEMENTOR_ASSETS_URL' ) ){
57 wp_enqueue_style( 'shopengine-frontend-font-awesome', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.css', [], \ShopEngine::version() );
58 }
59 }
60 }
61