PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.6.9
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.6.9
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 / archive-products / screens / default.php
shopengine / widgets / archive-products / screens Last commit date
default.php 1 year ago
default.php
245 lines
1 <?php
2 /**
3 * This template will overwrite the WooCommerce file: woocommerce/archive-product.php.
4 */
5 defined('ABSPATH') || exit;
6 \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_part_filter_by_match('woocommerce/content-product.php', 'templates/content-product.php');
7 \ShopEngine\Widgets\Widget_Helper::instance()->wc_template_filter();
8 \ShopEngine\Compatibility\Conflicts\Theme_Hooks::instance()->theme_conflicts__archive_products_widget_during_render();
9
10 // Extract settings passed from screen method
11 extract($settings_to_pass);
12 $wrap_extra_class = sprintf('%1$s%2$s', 'shopengine-grid', ($shopengine_is_hover_details !== 'yes' && $shopengine_group_btns !== 'yes') ? ' shopengine-hover-disable' : '');
13
14 $editor_mode = ( \Elementor\Plugin::$instance->editor->is_edit_mode() || is_preview() ) ;
15 ?>
16 <?php
17 if ( is_plugin_active( 'iconic-woo-image-swap/iconic-woo-image-swap.php' ) )
18 {
19 global $iconic_woo_image_swap_class;
20 remove_action('woocommerce_before_shop_loop_item',array($iconic_woo_image_swap_class,'template_loop_product_thumbnail'),5);
21
22 }
23 ?>
24
25
26 <?php
27 //Blocksy theme conflict issue
28 $themeName = get_template();
29 if($themeName == 'blocksy'):?>
30 <?php remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); ?>
31 <?php remove_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_rating', 20); ?>
32 <?php endif;
33 ?>
34
35 <?php
36 //Eduma theme conflict
37 $themeName = get_template();
38 if($themeName == 'eduma'):?>
39 <?php remove_filter('loop_shop_columns', '__return_false'); ?>
40 <?php endif;
41 ?>
42 <?php
43
44 if( !function_exists( 'custom_shopengine_product_title' ) ){
45 function custom_shopengine_product_title($header_size) {
46 global $product;
47 if ($product) {
48 shopengine_content_render(
49 sprintf(
50 '<%1$s class="woocommerce-loop-product__title">%2$s</%1$s>',
51 esc_attr($header_size),
52 esc_html(get_the_title($product->get_id()))
53 ) );
54
55 }
56 }
57 }
58
59 // Remove the default WooCommerce title hook and add the custom title function
60 remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
61 add_action('woocommerce_shop_loop_item_title', function() use ($settings_to_pass) {
62 $header_size = isset($settings_to_pass['shopengine_archive_product_title_header_size']) ? $settings_to_pass['shopengine_archive_product_title_header_size'] : 'h1';
63
64 if( function_exists( 'custom_shopengine_product_title' ) ) {
65
66 custom_shopengine_product_title($header_size);
67 }
68
69 }, 10);
70
71 ?>
72 <div data-pagination="<?php echo esc_attr($shopengine_pagination_style) ?>"
73 class="shopengine-archive-products <?php echo esc_attr($wrap_extra_class); ?>">
74 <?php
75 // add product description
76 add_action('woocommerce_after_shop_loop_item_title', function () use ($shopengine_is_details, $shopengine_group_btns, $shopengine_is_hover_details) {
77
78 if($shopengine_is_hover_details === 'yes') : ?>
79 <div class="shopengine-product-description-footer">
80 <?php endif;
81
82 if($shopengine_is_details === 'yes') :
83 ?>
84 <div class="shopengine-product-excerpt"> <?php
85 the_excerpt();
86 ?> </div> <?php
87 endif;
88
89 if($shopengine_is_hover_details === 'yes') : ?>
90 <?php if($shopengine_group_btns !== 'yes') : ?>
91 <div class="shopengine-product-description-btn-group">
92 <?php woocommerce_template_loop_add_to_cart(); ?>
93 </div>
94 <?php endif; ?>
95 </div> <?php
96 endif;
97 }, 40);
98
99 $wp_query_args = ['post_type' => 'product'];
100
101 // pagination next previous button label filter
102
103 if($shopengine_pagination_style === 'numeric') {
104 $control_args['prev_icon'] = '<i class="' . esc_attr($shopengine_pagination_prev_icon['value']) . '"></i>';
105 $control_args['next_icon'] = '<i class="' . esc_attr($shopengine_pagination_next_icon['value']) . '"></i>';
106 }
107
108 if($shopengine_pagination_style === 'default') {
109 $control_args['prev_icon'] = $shopengine_pagination_prev_text;
110 $control_args['next_icon'] = $shopengine_pagination_next_text;
111 }
112
113 if($shopengine_pagination_style === 'load-more' || $shopengine_pagination_style === 'load-more-on-scroll') {
114 $control_args['prev_icon'] = '';
115 $control_args['next_icon'] = $shopengine_pagination_loadmore_text;
116 }
117
118 if(isset($control_args)) {
119 add_filter('woocommerce_pagination_args', function ($args) use ($control_args) {
120 $args['prev_text'] = $control_args['prev_icon'];
121 $args['next_text'] = $control_args['next_icon'];
122
123 return $args;
124 });
125 }
126
127 $page_type = \ShopEngine\Widgets\Products::instance()->get_template_type_by_id(get_the_ID());
128 if(in_array($page_type, ['archive', 'shop', 'search']) && $editor_mode) {
129
130 global $wp_query, $post;
131 $main_query = clone $wp_query;
132 $main_post = clone $post;
133 $wp_query = new \WP_Query($wp_query_args);
134 wc_setup_loop(
135 [
136 'is_filtered' => is_filtered(),
137 'total' => $wp_query->found_posts,
138 'total_pages' => $wp_query->max_num_pages,
139 'per_page' => $wp_query->get('posts_per_page'),
140 'current_page' => max(1, $wp_query->get('paged', 1)),
141 ]
142 );
143 }
144
145 $run_loop = $editor_mode ? true : woocommerce_product_loop();
146
147 if( $editor_mode ) {
148
149 if(empty(WC()->session)) {
150 WC()->session = new WC_Session_Handler();
151 WC()->session->init();
152 }
153 }
154
155 //this option will come from Customizer > Woocmmerce > Product catelog > Products per row in mobile
156 $custom_catalog_option = get_theme_mod('shopengine_product_per_page_mobile', '2');
157 $custom_catalog_option_tablet = get_theme_mod('shopengine_product_per_page_tablet', '2');
158
159 $style = "
160 :root{
161 --shopengine-product-row-mobile : $custom_catalog_option;
162 --shopengine-product-row-tablet : $custom_catalog_option_tablet;
163 }
164 ";
165
166 if ($columns = get_option('woocommerce_catalog_columns')) {
167 $style = "
168 :root{
169 --wc-product-column : $columns;
170 --shopengine-product-row-mobile : $custom_catalog_option;
171 --shopengine-product-row-tablet : $custom_catalog_option_tablet;
172 }
173 ";
174 }
175 shopengine_content_render("<style>$style</style>");
176
177
178 if(wc_is_active_theme('kadence')):?>
179 <div class="product-details"> </div>
180 <?php endif;
181
182 $tooltip = !empty($settings['shopengine_is_tooltip']) ? $settings['shopengine_is_tooltip'] : '';
183 if($run_loop) {
184
185 do_action('woocommerce_before_shop_loop');
186
187 woocommerce_product_loop_start();
188
189 if(wc_get_loop_prop('total')) {
190 while(have_posts()) {
191 the_post();
192
193 /**
194 * Hook: woocommerce_shop_loop.
195 */
196 do_action('woocommerce_shop_loop');
197
198 global $product;
199
200 // Ensure visibility.
201 if ( ! empty( $product ) && $product->is_visible() ) : ?>
202
203 <li class="archive-product-container" data-tooltip="<?php echo esc_attr($tooltip); ?>">
204 <ul class="shopengine-archive-mode-grid">
205 <li class="shopengine-archive-products__left-image" >
206 <a title="<?php esc_html_e('Archive Product Left Image','shopengine')?>" href="<?php echo esc_url( get_the_permalink() ); ?>">
207 <?php shopengine_content_render( woocommerce_get_product_thumbnail( get_the_id() ) )?>
208 </a>
209 </li>
210
211 <?php wc_get_template_part('content', 'product');?>
212
213 </ul>
214 </li>
215 <?php endif;
216 }
217 }
218
219 woocommerce_product_loop_end();
220
221 /**
222 * Hook: woocommerce_after_shop_loop.
223 *
224 * @hooked woocommerce_pagination - 10
225 */
226 do_action('woocommerce_after_shop_loop');
227
228 } else {
229 /**
230 * Hook: woocommerce_no_products_found.
231 *
232 * @hooked wc_no_products_found - 10
233 */
234 do_action('woocommerce_no_products_found');
235 }
236
237 if(in_array($page_type, ['archive', 'shop', 'search']) && $editor_mode) {
238 $wp_query = $main_query;
239 $post = $main_post;
240 wp_reset_query();
241 wp_reset_postdata();
242 }
243 ?>
244 </div>
245