PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.18
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.18
1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 1.9.13 All 162 releases
woocommerce-pos / includes / API / Product_Search.php

Product_Search.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.18, at includes/API/Product_Search.php

69 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Legacy WCPOS search API; retained for Pro for one release.
4 *
5 * @package WCPOS\WooCommercePOS\API
6 */
7
8 namespace WCPOS\WooCommercePOS\API;
9
10 use WCPOS\WooCommercePOS\Sync\Collection_Rules;
11 use WCPOS\WooCommercePOS\Sync\Product_Search as Search_Rule;
12 use WP_Query;
13
14 /**
15 * Legacy search entry points.
16 *
17 * @deprecated Search is owned by Sync\Collection_Rules.
18 */
19 final class Product_Search {
20 /**
21 * Build product search SQL.
22 *
23 * @deprecated Use the Collection Rules plan.
24 *
25 * @param string $search Search SQL.
26 * @param WP_Query $wp_query Query instance.
27 * @return string
28 */
29 public static function posts_search( string $search, WP_Query $wp_query ): string {
30 return Search_Rule::posts_search( $search, $wp_query->query_vars, Collection_Rules::rules( 'products' )['search'] );
31 }
32 /**
33 * Join product search metadata.
34 *
35 * @deprecated Use the Collection Rules plan.
36 *
37 * @param string $join JOIN SQL.
38 * @param WP_Query $query Query instance.
39 * @return string
40 */
41 public static function posts_join( string $join, WP_Query $query ): string {
42 return Search_Rule::posts_join( $join, $query->query_vars );
43 }
44 /**
45 * Group product search results.
46 *
47 * @deprecated Use the Collection Rules plan.
48 *
49 * @param string $groupby GROUP BY SQL.
50 * @param WP_Query $query Query instance.
51 * @return string
52 */
53 public static function posts_groupby( string $groupby, WP_Query $query ): string {
54 return Search_Rule::posts_groupby( $groupby, $query->query_vars );
55 }
56 /**
57 * Rank exact product matches.
58 *
59 * @deprecated Use the Collection Rules plan.
60 *
61 * @param string $orderby ORDER BY SQL.
62 * @param WP_Query $query Query instance.
63 * @return string
64 */
65 public static function posts_orderby( string $orderby, WP_Query $query ): string {
66 return Search_Rule::posts_orderby( $orderby, $query->query_vars, Collection_Rules::rules( 'products' )['search'] );
67 }
68 }
69