PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.9.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.9.2
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 6 days ago
default.php
167 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 // Remove Auxin Shop template loader filter
93 if (is_plugin_active('auxin-shop/auxin-shop.php')) {
94
95 remove_filter('wc_get_template', 'auxshp_get_wc_template', 11, 2);
96
97 // Remove Auxin Shop template loader filter
98 global $wp_filter;
99 if (isset($wp_filter['woocommerce_locate_template'])) {
100 foreach ($wp_filter['woocommerce_locate_template']->callbacks as $priority => $callbacks) {
101 foreach ($callbacks as $key => $callback) {
102 if (is_array($callback['function']) &&
103 is_object($callback['function'][0]) &&
104 get_class($callback['function'][0]) === 'AUXSHP_Template_Loader' &&
105 $callback['function'][1] === 'load_templates') {
106 unset($wp_filter['woocommerce_locate_template']->callbacks[$priority][$key]);
107 }
108 }
109 }
110 }
111 }
112
113 // Get the current theme name
114 $themeName = get_template();
115
116 /*
117 ---------------------------------------------
118 Remove Envo Shop JS if Envo Shop is active
119 This is to prevent conflicts with ShopEngine's single product template
120 --------------------------------------------
121 */
122 if($themeName == 'envo-shop') {
123
124 // Stop Envo Shop from rendering its own duplicate plus/minus buttons
125 remove_action('woocommerce_before_add_to_cart_quantity', 'envo_shop_display_quantity_minus');
126 remove_action('woocommerce_after_add_to_cart_quantity', 'envo_shop_display_quantity_plus');
127 }
128
129
130 // Check if gift card plugin is active and enabled first
131 $gift_card_plugin_active = function_exists('is_plugin_active') ? is_plugin_active('wt-woocommerce-gift-cards/wt-woocommerce-gift-cards.php') : false;
132 $gift_card_class_exists = class_exists('Wt_Gc_Gift_Card_Purchase_Setup_Product_Page');
133 $gift_card_support_enabled = !empty($shopengine_woocommerce_gift_card_support) && $shopengine_woocommerce_gift_card_support === 'yes';
134
135 // Only proceed if gift card functionality is fully available
136 if ($gift_card_plugin_active && $gift_card_class_exists && $gift_card_support_enabled) {
137 $product_id = $product->get_id();
138 $is_gift_card_product = metadata_exists( 'post', $product_id, '_wt_gc_gift_card_product' ) && get_post_meta( $product_id, '_wt_gc_gift_card_product', true );
139
140 if ($is_gift_card_product) {
141 $gift_card_setup = Wt_Gc_Gift_Card_Purchase_Setup_Product_Page::get_instance();
142
143 // Check if templates are enabled for this product
144 if (method_exists($gift_card_setup, 'is_templates_enabled') && $gift_card_setup::is_templates_enabled($product_id)) {
145 // Use the complete gift card template design when support is enabled
146 $gift_card_setup->shop_single_page_design();
147 }
148 } else {
149 // For regular products when gift card plugin is active, use standard WooCommerce action
150 do_action('woocommerce_' . $product->get_type() . '_add_to_cart');
151 }
152 } else {
153 // When gift card plugin is not active, use standard WooCommerce action
154 do_action('woocommerce_' . $product->get_type() . '_add_to_cart');
155 }
156
157 if($editor_mode) {
158 $wp_query = $main_query;
159 $post = $main_post;
160 wp_reset_query();
161 wp_reset_postdata();
162 }
163
164 ?>
165
166 </div>
167