PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.0.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.0.0
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 / advanced-search / screens / search-result.php
shopengine / widgets / advanced-search / screens Last commit date
default.php 5 years ago search-result.php 5 years ago
search-result.php
116 lines
1 <?php
2
3
4 if( !empty($_GET['s'])) {
5
6 $args = array(
7 'orderby' => 'date',
8 'post_status' => 'publish',
9 'post_type' => esc_attr( $_GET['post_type'] ),
10 's' => esc_attr( $_GET['s'] ),
11 'posts_per_page' => 30,
12 );
13
14 if( !empty( $_GET['product_cat']) ) {
15
16 $cats = explode(',', trim($_GET['product_cat'], ','));
17
18 $sanitized = array_map(function ($val){
19
20 return intval($val);
21
22 }, $cats);
23
24 $args['tax_query'] = array(
25 array(
26 'taxonomy' => 'product_cat',
27 'field' => 'term_id',
28 'terms' => $sanitized,
29 'operator' => 'IN'
30 )
31 );
32 }
33
34 $query = new WP_Query($args);
35 }
36
37 if( $query->have_posts()):
38 ?>
39
40 <div class="shopengine-search-product">
41
42 <?php
43 while ( $query->have_posts() ) : $query->the_post();
44 $id = esc_attr( get_the_ID() );
45 $image_url = get_the_post_thumbnail_url( $id );
46 $product = wc_get_product( $id );
47 $price = wc_price($product->get_price());
48 $reg_price = wc_price($product->get_regular_price());
49 ?>
50
51 <div class="shopengine-search-product__item">
52 <div class="shopengine-search-product__item--image">
53 <img src="<?php echo esc_url( $image_url ) ?>">
54 </div>
55 <div class="shopengine-search-product__item--content">
56 <h4 class="shopengine-search-product__item--title">
57 <a href="<?php the_permalink() ?>"> <?php the_title() ?> </a>
58 </h4>
59 <div class="shopengine-product-rating">
60 <?php
61 if($product->get_rating_count() > 0){
62 woocommerce_template_loop_rating();
63 } else {
64 $rating_html = '<div class="star-rating">';
65 $rating_html .= wc_get_star_rating_html( 0, 0 );
66 $rating_html .= '</div>';
67
68 echo wp_kses_post($rating_html);
69 }
70
71 // review count
72 $review_count = $product->get_review_count();
73 echo "<span class='rating-count'>(". $review_count .")</span>";
74 ?>
75 </div>
76 <div class="shopengine-search-product__item--price">
77 <?php if( !empty( $product->get_sale_price() ) ) : ?>
78 <del>
79 <span class="woocommerce-Price-amount amount">
80 <?php echo \Shopengine\Utils\Helper::kses( $reg_price ) ?>
81 </span>
82 </del>
83 <?php endif; ?>
84 <ins><span class="woocommerce-Price-amount amount"><?php echo \Shopengine\Utils\Helper::kses( $price ) ?> </span></ins>
85 </div>
86 </div>
87
88 <a class="shopengine-search-more-btn" href="<?php echo get_the_permalink(); ?>"><i class="fas fa-chevron-right"></i></a>
89 </div>
90
91 <?php
92
93 endwhile;
94 wp_reset_query();
95 wp_reset_postdata();
96
97 ?>
98
99 <div class="shopengine-search-product__item">
100 <a class="shopengine-search-more-products" href="<?php echo get_the_permalink(get_option('woocommerce_shop_page_id')); ?>"><i class="fas fa-retweet"></i><?php echo esc_html__('More Products', 'shopengine'); ?></a>
101 </div>
102
103 </div>
104
105 <?php
106
107 else: ?>
108 <div class="shopengine-search-product">
109 <div>
110 <?php echo esc_html__('No result found', 'shopengine'); ?>
111 </div>
112 </div>
113 <?php
114
115 endif;
116