PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / trunk
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution vtrunk
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 / route.php
shopengine / widgets / init Last commit date
assets 1 day ago enqueue-scripts.php 11 months ago route.php 1 year ago
route.php
95 lines
1 <?php
2
3 namespace ShopEngine\Widgets\Init;
4
5 use ShopEngine\Base\Api;
6 defined('ABSPATH') || exit;
7 class Route extends Api
8 {
9
10 public function config() {
11
12 $this->prefix = 'widgets_partials';
13 $this->param = "";
14 }
15
16 public function get_filter_cat_products() {
17
18 $data = $this->request->get_params();
19
20 $products = $data['products'];
21 $order = isset($data['order']) ? $data['order'] : 'DESC';
22 $order_by = isset($data['order_by']) ? $data['order_by'] : 'date';
23 $settings = isset($data['settings']) ? $data['settings'] : null;
24
25 if(empty($products)) {
26
27 echo "<p class='error'>" . esc_html__('No products were found.', 'shopengine') . "</p>";
28
29 exit();
30 }
31
32 $args = array(
33 'post_type' => 'product',
34 'order' => $order,
35 'orderby' => $order_by,
36 'post__in' => $products,
37 'posts_per_page' => 50
38 );
39
40
41 $query = new \WP_Query($args);
42
43 if($query->have_posts()) :
44 while($query->have_posts()) : $query->the_post();
45
46 $default_content = [
47 'image' => 0,
48 'category' => 0,
49 'title' => 0,
50 'rating' => 0,
51 'price' => 0,
52 'description' => 0,
53 'buttons' => 0,
54 ];
55
56
57
58 $content = (!empty($view) ? $view : $default_content);
59 asort($content, SORT_NUMERIC);
60
61 if( $settings['shopengine_is_cats'] != 'yes' ) unset($content['category']);
62 if( $settings['shopengine_is_details'] != 'yes' ) {
63 unset($content['description']);
64 }
65 if( $settings['shopengine_is_product_rating'] != 'yes' ) unset($content['rating']);
66
67
68 ?> <div class='shopengine-single-product-item'> <?php
69 foreach($content as $key => $value) {
70 $function = '_product_' . $key;
71 \ShopEngine\Utils\Helper::$function($settings);
72 }
73 ?> </div> <?php
74
75 endwhile;
76 endif;
77
78 wp_reset_postdata();
79
80 exit();
81 }
82
83 public function post_checkout_login() {
84 $data = $this->request->get_params();
85 if(isset($data['rememberme'])) {
86 $data['rememberme'] = $data['rememberme'] == 'true' ? true : false;
87 }
88 $user = wp_signon($data);
89 if(is_wp_error($user)) {
90 return new \WP_Error('failed_login', $user->get_error_message(), ['status' => 404]);
91 }
92 return true;
93 }
94 }
95