PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.6.5
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.6.5
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 / add-to-cart / screens / default.php
shopengine / widgets / add-to-cart / screens Last commit date
default.php 3 years ago
default.php
104 lines
1 <?php $data_attr = apply_filters('shopengine/add_to_cart_widget/optional_tooltip_data_attr', ''); ?>
2
3 <div class='shopengine-swatches' <?php echo esc_attr($data_attr)?>>
4
5 <?php
6
7 $editor_mode = (\Elementor\Plugin::$instance->editor->is_edit_mode() || is_preview());
8
9 if(get_post_type() == \ShopEngine\Core\Template_Cpt::TYPE) {
10
11 if($product->get_stock_status() != 'instock') {
12
13 echo esc_html__('To see the add to cart button , please set stock status as instock for - .', 'shopengine') . '"' . esc_html( $product->get_name() ) . '"';
14 }
15 }
16
17 /*
18 ---------------------------------------------
19 Add action for woocommerce quantity button
20 --------------------------------------------
21 */
22
23 if(!$product->is_sold_individually()) {
24
25 $stock_quantity = $product->get_stock_quantity();
26
27 if($stock_quantity != 1){
28
29 // plus minus button
30
31 $btn_arg = [
32 'plus_icon' => $shopengine_quantity_plus_icon,
33 'minus_icon' => $shopengine_quantity_minus_icon,
34 'position' => $shopengine_quantity_btn_position,
35 ];
36
37 add_action('woocommerce_before_add_to_cart_quantity', function () use ($btn_arg) {
38
39 echo wp_kses(sprintf('<div class="quantity-wrap %1$s">', $btn_arg['position']), \ShopEngine\Utils\Helper::get_kses_array());
40
41
42 if($btn_arg['position'] === 'before') { ?>
43 <div class="shopengine-qty-btn">
44 <button type="button"
45 class="plus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['plus_icon'], ['aria-hidden' => 'true']); ?> </button>
46 <button type="button"
47 class="minus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['minus_icon'], ['aria-hidden' => 'true']); ?> </button>
48 </div>
49 <?php
50 }
51
52 if($btn_arg['position'] === 'both') { ?>
53 <button type="button"
54 class="minus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['minus_icon'], ['aria-hidden' => 'true']); ?> </button>
55 <?php
56 }
57 });
58
59 add_action('woocommerce_after_add_to_cart_quantity', function () use ($btn_arg) {
60
61 if($btn_arg['position'] === 'after') { ?>
62 <div class="shopengine-qty-btn">
63 <button type="button"
64 class="plus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['plus_icon'], ['aria-hidden' => 'true']); ?> </button>
65 <button type="button"
66 class="minus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['minus_icon'], ['aria-hidden' => 'true']); ?> </button>
67 </div>
68 <?php
69 }
70
71 if($btn_arg['position'] === 'both') { ?>
72 <button type="button"
73 class="plus"> <?php \Elementor\Icons_Manager::render_icon($btn_arg['plus_icon'], ['aria-hidden' => 'true']); ?> </button>
74 <?php
75 }
76
77 echo '</div>';
78 });
79 }
80 }
81
82 if($editor_mode) {
83
84 global $wp_query, $post;;
85 $main_query = clone $wp_query;
86 $main_post = clone $post;
87
88 $wp_query = new \WP_Query([]);
89 }
90
91
92 do_action('woocommerce_' . $product->get_type() . '_add_to_cart');
93
94 if($editor_mode) {
95 $wp_query = $main_query;
96 $post = $main_post;
97 wp_reset_query();
98 wp_reset_postdata();
99 }
100
101 ?>
102
103 </div>
104