PluginProbe
ElasticPress / 4.2.2
ElasticPress v4.2.2
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / assets / js / instant-results / config.js

config.js in ElasticPress 4.2.2, at assets/js/instant-results/config.js

76 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies.
3 */
4 import { __ } from '@wordpress/i18n';
5
6 /**
7 * Window dependencies.
8 */
9 const {
10 apiEndpoint,
11 apiHost,
12 argsSchema,
13 currencyCode,
14 facets,
15 isWooCommerce,
16 locale,
17 matchType,
18 paramPrefix,
19 postTypeLabels,
20 taxonomyLabels,
21 } = window.epInstantResults;
22
23 /**
24 * Sorting options configuration.
25 */
26 const sortOptions = {
27 relevance_desc: {
28 name: __('Most relevant', 'elasticpress'),
29 orderby: 'relevance',
30 order: 'desc',
31 currencyCode,
32 },
33 date_desc: {
34 name: __('Date, newest to oldest', 'elasticpress'),
35 orderby: 'date',
36 order: 'desc',
37 },
38 date_asc: {
39 name: __('Date, oldest to newest', 'elasticpress'),
40 orderby: 'date',
41 order: 'asc',
42 },
43 };
44
45 /**
46 * Sort by price is only available for WooCommerce.
47 */
48 if (isWooCommerce) {
49 sortOptions.price_desc = {
50 name: __('Price, highest to lowest', 'elasticpress'),
51 orderby: 'price',
52 order: 'desc',
53 };
54
55 sortOptions.price_asc = {
56 name: __('Price, lowest to highest', 'elasticpress'),
57 orderby: 'price',
58 order: 'asc',
59 };
60 }
61
62 export {
63 apiEndpoint,
64 apiHost,
65 argsSchema,
66 currencyCode,
67 facets,
68 isWooCommerce,
69 locale,
70 matchType,
71 paramPrefix,
72 postTypeLabels,
73 sortOptions,
74 taxonomyLabels,
75 };
76