PluginProbe
ElasticPress / 5.0.2
ElasticPress v5.0.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 / includes / classes / Feature / WooCommerce / WooCommerce.php

WooCommerce.php in ElasticPress 5.0.2, at includes/classes/Feature/WooCommerce/WooCommerce.php

692 lines 24.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * ElasticPress WooCommerce feature
4 *
5 * @since 2.1
6 * @package elasticpress
7 */
8
9 namespace ElasticPress\Feature\WooCommerce;
10
11 use ElasticPress\Feature;
12 use ElasticPress\FeatureRequirementsStatus;
13 use ElasticPress\Indexables;
14 use ElasticPress\IndexHelper;
15 use ElasticPress\Utils;
16
17 if ( ! defined( 'ABSPATH' ) ) {
18 exit; // Exit if accessed directly.
19 }
20
21 /**
22 * WooCommerce feature class
23 */
24 class WooCommerce extends Feature {
25 /**
26 * If enabled, receive the OrdersAutosuggest object instance
27 *
28 * @since 4.7.0
29 * @var null|OrdersAutosuggest
30 */
31 public $orders_autosuggest = null;
32
33 /**
34 * Receive the Products object instance
35 *
36 * @since 4.7.0
37 * @var null|Products
38 */
39 public $products = null;
40
41 /**
42 * Receive the Orders object instance
43 *
44 * @since 4.5.0
45 * @var null|Orders
46 */
47 public $orders = null;
48
49 /**
50 * Initialize feature setting it's config
51 *
52 * @since 3.0
53 */
54 public function __construct() {
55 $this->slug = 'woocommerce';
56
57 $this->title = esc_html__( 'WooCommerce', 'elasticpress' );
58
59 $this->summary = '<p>' . __( 'Most caching and performance tools can’t keep up with the nearly infinite ways your visitors might filter or navigate your products. No matter how many products, filters, or customers you have, ElasticPress will keep your online store performing quickly. If used in combination with the Protected Content feature, ElasticPress will also accelerate order searches and back end product management.', 'elasticpress' ) . '</p>';
60
61 $this->docs_url = __( 'https://elasticpress.zendesk.com/hc/en-us/articles/360050447492-Configuring-ElasticPress-via-the-Plugin-Dashboard#woocommerce', 'elasticpress' );
62
63 $this->requires_install_reindex = true;
64
65 $this->setting_requires_install_reindex = 'orders';
66
67 $this->available_during_installation = true;
68
69 $this->default_settings = [
70 'orders' => '0',
71 ];
72
73 $this->orders = new Orders( $this );
74 $this->products = new Products( $this );
75 $this->orders_autosuggest = new OrdersAutosuggest();
76
77 parent::__construct();
78 }
79
80 /**
81 * Setup all feature filters
82 *
83 * @since 2.1
84 */
85 public function setup() {
86 if ( ! function_exists( 'WC' ) ) {
87 return;
88 }
89
90 add_action( 'switch_blog', [ $this, 'setup_or_tear_down' ] );
91
92 add_filter( 'ep_integrate_search_queries', [ $this, 'disallow_coupons' ], 10, 2 );
93
94 $this->products->setup();
95 $this->orders->setup();
96
97 // Orders Autosuggest feature.
98 if ( $this->is_orders_autosuggest_enabled() ) {
99 $this->orders_autosuggest->setup();
100 }
101 }
102
103 /**
104 * Setup or tear down the functionality depending on the plugin being active for the current site.
105 *
106 * If the site wasn't initialized yet (it does not have its database tables created) we skip it.
107 *
108 * @since 5.0.0
109 * @param int $blog_id Blog ID
110 * @return void
111 */
112 public function setup_or_tear_down( $blog_id ) {
113 include_once ABSPATH . 'wp-admin/includes/plugin.php';
114 if ( wp_is_site_initialized( $blog_id ) && \is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
115 $this->setup();
116 } else {
117 $this->tear_down();
118 }
119 }
120
121 /**
122 * Un-setup all feature filters
123 *
124 * @since 5.0.0
125 */
126 public function tear_down() {
127 remove_filter( 'ep_integrate_search_queries', [ $this, 'disallow_coupons' ] );
128
129 $this->products->tear_down();
130 $this->orders->tear_down();
131
132 // Orders Autosuggest feature.
133 if ( $this->is_orders_autosuggest_enabled() ) {
134 $this->orders_autosuggest->tear_down();
135 }
136 }
137
138 /**
139 * Given a WP_Query object, return its search term (if any)
140 *
141 * This method also accounts for the `'search'` parameter used by
142 * WooCommerce, in addition to the regular `'s'` parameter.
143 *
144 * @param \WP_Query $query The WP_Query object
145 * @return string
146 */
147 public function get_search_term( \WP_Query $query ) : string {
148 $search = $query->get( 'search' );
149 return ( ! empty( $search ) ) ? $search : $query->get( 's', '' );
150 }
151
152 /**
153 * Make search coupons don't go through ES
154 *
155 * @param bool $enabled Coupons enabled or not
156 * @param WP_Query $query WP Query
157 * @since 4.7.0
158 * @return bool
159 */
160 public function disallow_coupons( $enabled, $query ) {
161 if ( is_admin() ) {
162 return $enabled;
163 }
164
165 if ( 'shop_coupon' === $query->get( 'post_type' ) && empty( $query->query_vars['ep_integrate'] ) ) {
166 return false;
167 }
168
169 return $enabled;
170 }
171
172 /**
173 * Output feature box long
174 *
175 * @since 2.1
176 */
177 public function output_feature_box_long() {
178 ?>
179 <p><?php esc_html_e( 'Most caching and performance tools can’t keep up with the nearly infinite ways your visitors might filter or navigate your products. No matter how many products, filters, or customers you have, ElasticPress will keep your online store performing quickly. If used in combination with the Protected Content feature, ElasticPress will also accelerate order searches and back end product management.', 'elasticpress' ); ?></p>
180 <?php
181 }
182
183 /**
184 * Dashboard WooCommerce settings
185 *
186 * @since 4.5.0
187 */
188 public function output_feature_box_settings() {
189 $available = $this->is_orders_autosuggest_available();
190 $enabled = $this->is_orders_autosuggest_enabled();
191 ?>
192 <div class="field">
193 <div class="field-name status"><?php esc_html_e( 'Orders Autosuggest', 'elasticpress' ); ?></div>
194 <div class="input-wrap">
195 <label><input name="settings[orders]" type="radio" <?php checked( $enabled ); ?> <?php disabled( $available, false, true ); ?> value="1"><?php echo wp_kses_post( __( 'Enabled', 'elasticpress' ) ); ?></label><br>
196 <label><input name="settings[orders]" type="radio" <?php checked( ! $enabled ); ?> <?php disabled( $available, false, true ); ?> value="0"><?php echo wp_kses_post( __( 'Disabled', 'elasticpress' ) ); ?></label>
197 <p class="field-description">
198 <?php
199 $epio_autosuggest_kb_link = 'https://elasticpress.zendesk.com/hc/en-us/articles/13374461690381-Configuring-ElasticPress-io-Order-Autosuggest';
200
201 $message = ( $available ) ?
202 /* translators: 1: <a> tag (ElasticPress.io); 2. </a>; 3: <a> tag (KB article); 4. </a>; */
203 __( 'You are directly connected to %1$sElasticPress.io%2$s! Enable Orders Autosuggest to enhance Dashboard results and quickly find WooCommerce Orders. %3$sLearn More%4$s.', 'elasticpress' ) :
204 /* translators: 1: <a> tag (ElasticPress.io); 2. </a>; 3: <a> tag (KB article); 4. </a>; */
205 __( 'Due to the sensitive nature of orders, this autosuggest feature is available only to %1$sElasticPress.io%2$s customers. %3$sLearn More%4$s.', 'elasticpress' );
206
207 printf(
208 wp_kses( $message, 'ep-html' ),
209 '<a href="https://elasticpress.io/" target="_blank">',
210 '</a>',
211 '<a href="' . esc_url( $epio_autosuggest_kb_link ) . '" target="_blank">',
212 '</a>'
213 );
214 ?>
215 </p>
216 </div>
217 </div>
218 <?php
219 }
220
221 /**
222 * Determine WC feature reqs status
223 *
224 * @since 2.2
225 * @return EP_Feature_Requirements_Status
226 */
227 public function requirements_status() {
228 $status = new FeatureRequirementsStatus( 0 );
229
230 if ( ! class_exists( 'WooCommerce' ) ) {
231 $status->code = 2;
232 $status->message = esc_html__( 'WooCommerce not installed.', 'elasticpress' );
233 }
234
235 return $status;
236 }
237
238 /**
239 * Determines whether or not ES should be integrating with the provided query
240 *
241 * @param \WP_Query $query Query we might integrate with
242 *
243 * @return bool
244 */
245 public function should_integrate_with_query( $query ) {
246 // Lets make sure this doesn't interfere with the CLI
247 if ( defined( 'WP_CLI' ) && WP_CLI ) {
248 return false;
249 }
250
251 if ( defined( 'WC_API_REQUEST' ) && WC_API_REQUEST ) {
252 return false;
253 }
254
255 if ( isset( $query->query_vars['ep_integrate'] ) && ! filter_var( $query->query_vars['ep_integrate'], FILTER_VALIDATE_BOOLEAN ) ) {
256 return false;
257 }
258
259 /**
260 * Filter to skip WP Query integration
261 *
262 * @hook ep_skip_query_integration
263 * @param {bool} $skip True to skip
264 * @param {WP_Query} $query WP Query to evaluate
265 * @return {bool} New skip value
266 */
267 if ( apply_filters( 'ep_skip_query_integration', false, $query ) ) {
268 return false;
269 }
270
271 if ( ! Utils\is_integrated_request( $this->slug ) ) {
272 return false;
273 }
274
275 /**
276 * Do nothing for single product queries
277 */
278 $product_name = $query->get( 'product', false );
279 if ( ! empty( $product_name ) || $query->is_single() ) {
280 return false;
281 }
282
283 /**
284 * ElasticPress does not yet support post_parent queries
285 */
286 $post_parent = $query->get( 'post_parent', false );
287 if ( ! empty( $post_parent ) ) {
288 return false;
289 }
290
291 /**
292 * If this is just a preview, let's not use Elasticsearch.
293 */
294 if ( $query->get( 'preview', false ) ) {
295 return false;
296 }
297
298 return true;
299 }
300
301 /**
302 * Whether orders autosuggest is available or not
303 *
304 * @since 4.5.0
305 * @return boolean
306 */
307 public function is_orders_autosuggest_available() : bool {
308 /**
309 * Whether the autosuggest feature is available for non
310 * ElasticPress.io customers.
311 *
312 * @since 4.5.0
313 * @hook ep_woocommerce_orders_autosuggest_available
314 * @param {boolean} $available Whether the feature is available.
315 */
316 return apply_filters( 'ep_woocommerce_orders_autosuggest_available', Utils\is_epio() );
317 }
318
319 /**
320 * Whether orders autosuggest is enabled or not
321 *
322 * @since 4.5.0
323 * @return boolean
324 */
325 public function is_orders_autosuggest_enabled() : bool {
326 return $this->is_orders_autosuggest_available() && '1' === $this->get_setting( 'orders' );
327 }
328
329 /**
330 * Set the `settings_schema` attribute
331 *
332 * @since 5.0.0
333 */
334 protected function set_settings_schema() {
335 $available = $this->is_orders_autosuggest_available();
336
337 $epio_autosuggest_kb_link = 'https://elasticpress.zendesk.com/hc/en-us/articles/13374461690381-Configuring-ElasticPress-io-Order-Autosuggest';
338
339 $message = ( $available ) ?
340 /* translators: 1: <a> tag (ElasticPress.io); 2. </a>; 3: <a> tag (KB article); 4. </a>; */
341 __( 'You are directly connected to %1$sElasticPress.io%2$s! Enable autosuggest for Orders to enhance Dashboard results and quickly find WooCommerce Orders. %3$sLearn More%4$s.', 'elasticpress' ) :
342 /* translators: 1: <a> tag (ElasticPress.io); 2. </a>; 3: <a> tag (KB article); 4. </a>; */
343 __( 'Due to the sensitive nature of orders, this autosuggest feature is available only to %1$sElasticPress.io%2$s customers. %3$sLearn More%4$s.', 'elasticpress' );
344
345 $message = sprintf(
346 wp_kses( $message, 'ep-html' ),
347 '<a href="https://elasticpress.io/" target="_blank">',
348 '</a>',
349 '<a href="' . esc_url( $epio_autosuggest_kb_link ) . '" target="_blank">',
350 '</a>'
351 );
352
353 $this->settings_schema = [
354 [
355 'default' => '0',
356 'disabled' => ! $available,
357 'help' => $message,
358 'key' => 'orders',
359 'label' => __( 'Show suggestions when searching for Orders', 'elasticpress' ),
360 'requires_sync' => true,
361 'type' => 'checkbox',
362 ],
363 ];
364 }
365
366 /**
367 * DEPRECATED. Translate args to ElasticPress compat format. This is the meat of what the feature does
368 *
369 * @param \WP_Query $query WP Query
370 * @since 2.1
371 */
372 public function translate_args( $query ) {
373 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->translate_args() OR \ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->translate_args()" );
374 $this->products->translate_args( $query );
375 $this->orders->translate_args( $query );
376 }
377
378 /**
379 * DEPRECATED. Fetch the ES related meta mapping for orderby
380 *
381 * @param array $meta_key The meta key to get the mapping for.
382 * @since 2.1
383 * @return string The mapped meta key.
384 */
385 public function get_orderby_meta_mapping( $meta_key ) {
386 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->get_orderby_meta_mapping()" );
387 return $this->products->get_orderby_meta_mapping( $meta_key );
388 }
389
390 /**
391 * DEPRECATED. Remove the author_name from search fields.
392 *
393 * @param array $search_fields Array of search fields.
394 * @since 3.0
395 * @return array
396 */
397 public function remove_author( $search_fields ) {
398 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->remove_author()" );
399 return $this->products->remove_author( $search_fields );
400 }
401
402 /**
403 * DEPRECATED. Index WooCommerce meta
404 *
405 * @param array $meta Existing post meta.
406 * @param array $post Post arguments array.
407 * @since 2.1
408 * @return array
409 */
410 public function whitelist_meta_keys( $meta, $post ) {
411 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->allow_meta_keys() AND/OR \ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->allow_meta_keys()" );
412 return array_unique(
413 array_merge(
414 $this->products->allow_meta_keys( $meta ),
415 $this->orders->allow_meta_keys( $meta )
416 )
417 );
418 }
419
420 /**
421 * DEPRECATED. Index WooCommerce taxonomies
422 *
423 * @param array $taxonomies Index taxonomies array.
424 * @param array $post Post properties array.
425 * @since 2.1
426 * @return array
427 */
428 public function whitelist_taxonomies( $taxonomies, $post ) {
429 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->sync_taxonomies()" );
430 return $this->products->sync_taxonomies( $taxonomies );
431 }
432
433 /**
434 * DEPRECATED. Returns the WooCommerce-oriented post types in admin that EP will search
435 *
436 * @since 4.4.0
437 * @return mixed|void
438 */
439 public function get_admin_searchable_post_types() {
440 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->get_admin_searchable_post_types()" );
441 return $this->orders->get_admin_searchable_post_types();
442 }
443
444 /**
445 * DEPRECATED. Make search coupons don't go through ES
446 *
447 * @param bool $enabled Coupons enabled or not
448 * @param WP_Query $query WP Query
449 * @since 2.1
450 * @return bool
451 */
452 public function blacklist_coupons( $enabled, $query ) {
453 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->disallow_coupons()" );
454 return $this->disallow_coupons( $enabled, $query );
455 }
456
457 /**
458 * DEPRECATED. Allow order creations on the front end to get synced
459 *
460 * @since 2.1
461 * @param bool $override Original order perms check value
462 * @param int $post_id Post ID
463 * @return bool
464 */
465 public function bypass_order_permissions_check( $override, $post_id ) {
466 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->price_filter()" );
467 return $this->orders->bypass_order_permissions_check( $override, $post_id );
468 }
469
470 /**
471 * DEPRECATED. Sets WooCommerce meta search fields to an empty array if we are integrating the main query with ElasticSearch
472 *
473 * WooCommerce calls this action as part of its own callback on parse_query. We add this filter only if the query
474 * is integrated with ElasticSearch.
475 * If we were to always return array() on this filter, we'd break admin searches when WooCommerce module is activated
476 * without the Protected Content Module
477 *
478 * @param \WP_Query $query Current query
479 */
480 public function maybe_hook_woocommerce_search_fields( $query ) {
481 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->maybe_hook_woocommerce_search_fields()" );
482 return $this->orders->maybe_hook_woocommerce_search_fields( $query );
483 }
484
485 /**
486 * DEPRECATED. Enhance WooCommerce search order by order id, email, phone number, name, etc..
487 * What this function does:
488 * 1. Reverse the woocommerce shop_order_search_custom_fields query
489 * 2. If the search key is integer and it is an Order Id, just query with post__in
490 * 3. If the search key is integer but not an order id ( might be phone number ), use ES to find it
491 *
492 * @param WP_Query $wp WP Query
493 * @since 2.3
494 */
495 public function search_order( $wp ) {
496 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->search_order()" );
497 return $this->orders->search_order( $wp );
498 }
499
500 /**
501 * DEPRECATED. Add order items as a searchable string.
502 *
503 * This mimics how WooCommerce currently does in the order_itemmeta
504 * table. They combine the titles of the products and put them in a
505 * meta field called "Items".
506 *
507 * @since 2.4
508 *
509 * @param array $post_args Post arguments
510 * @param string|int $post_id Post id
511 *
512 * @return array
513 */
514 public function add_order_items_search( $post_args, $post_id ) {
515 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->add_order_items_search()" );
516 return $this->orders->add_order_items_search( $post_args, $post_id );
517 }
518
519 /**
520 * DEPRECATED. Add WooCommerce Product Attributes to EP Facets.
521 *
522 * @param array $taxonomies Taxonomies array
523 * @return array
524 */
525 public function add_product_attributes( $taxonomies = [] ) {
526 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->add_product_attributes()" );
527 return $this->products->add_product_attributes( $taxonomies );
528 }
529
530 /**
531 * DEPRECATED. Add WooCommerce Fields to the Weighting Dashboard.
532 *
533 * @since 3.x
534 *
535 * @param array $fields Current weighting fields.
536 * @param string $post_type Current post type.
537 * @return array New fields.
538 */
539 public function add_product_attributes_to_weighting( $fields, $post_type ) {
540 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->add_product_attributes_to_weighting()" );
541 return $this->products->add_product_attributes_to_weighting( $fields, $post_type );
542 }
543
544 /**
545 * DEPRECATED. Add WooCommerce Fields to the default values of the Weighting Dashboard.
546 *
547 * @since 3.x
548 *
549 * @param array $defaults Default values for the post type.
550 * @param string $post_type Current post type.
551 * @return array
552 */
553 public function add_product_default_post_type_weights( $defaults, $post_type ) {
554 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->add_product_default_post_type_weights()" );
555 return $this->products->add_product_default_post_type_weights( $defaults, $post_type );
556 }
557
558 /**
559 * DEPRECATED. Add WC post type to autosuggest
560 *
561 * @param array $post_types Array of post types (e.g. post, page).
562 * @since 2.6
563 * @return array
564 */
565 public function suggest_wc_add_post_type( $post_types ) {
566 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->suggest_wc_add_post_type()" );
567 return $this->products->suggest_wc_add_post_type( $post_types );
568 }
569
570 /**
571 * DEPRECATED. Modifies main query to allow filtering by price with WooCommerce "Filter by price" widget.
572 *
573 * @param array $args ES args
574 * @param array $query_args WP_Query args
575 * @param WP_Query $query WP_Query object
576 * @since 3.2
577 * @return array
578 */
579 public function price_filter( $args, $query_args, $query ) {
580 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->price_filter()" );
581 return $this->products->price_filter( $args, $query_args, $query );
582 }
583
584 /**
585 * DEPRECATED. Prevent order fields from being removed.
586 *
587 * When Protected Content is enabled, all posts with password have their content removed.
588 * This can't happen for orders, as the order key is added in that field.
589 *
590 * @see https://github.com/10up/ElasticPress/issues/2726
591 *
592 * @since 4.2.0
593 * @param bool $skip Whether the password protected content should have their content, and meta removed
594 * @param array $post_args Post arguments
595 * @return bool
596 */
597 public function keep_order_fields( $skip, $post_args ) {
598 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->orders->keep_order_fields()" );
599 return $this->orders->keep_order_fields( $skip, $post_args );
600 }
601
602 /**
603 * DEPRECATED. Add a new `_variations_skus` meta field to the product to be indexed in Elasticsearch.
604 *
605 * @since 4.2.0
606 * @param array $post_meta Post meta
607 * @param WP_Post $post Post object
608 * @return array
609 */
610 public function add_variations_skus_meta( $post_meta, $post ) {
611 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->add_variations_skus_meta()" );
612 return $this->products->add_variations_skus_meta( $post_meta, $post );
613 }
614
615 /**
616 * DEPRECATED. Integrate ElasticPress with the WooCommerce Admin Product List.
617 *
618 * WooCommerce uses its `WC_Admin_List_Table_Products` class to control that screen. This
619 * function adds all necessary hooks to bypass the default behavior and integrate with ElasticPress.
620 * By default, WC runs a SQL query to get the Product IDs that match the list criteria and passes
621 * that list of IDs to the main WP_Query. This integration changes that process to a single query, run
622 * by ElasticPress.
623 *
624 * @since 4.2.0
625 * @param array $query_vars Query vars.
626 * @return array
627 */
628 public function admin_product_list_request_query( $query_vars ) {
629 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->admin_product_list_request_query()" );
630 return $this->products->admin_product_list_request_query( $query_vars );
631 }
632
633 /**
634 * DEPRECATED. Apply the necessary changes to WP_Query in WooCommerce Admin Product List.
635 *
636 * @param WP_Query $query The WP Query being executed.
637 */
638 public function translate_args_admin_products_list( $query ) {
639 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->price_filter()" );
640 $this->products->translate_args_admin_products_list( $query );
641 }
642
643 /**
644 * DEPRECATED. Depending on the number of products display an admin notice in the custom sort screen for WooCommerce Products
645 *
646 * @since 4.4.0
647 * @param array $notices Current ElasticPress admin notices
648 * @return array
649 */
650 public function maybe_display_notice_about_product_ordering( $notices ) {
651 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->maybe_display_notice_about_product_ordering()" );
652 return $this->products->maybe_display_notice_about_product_ordering( $notices );
653 }
654
655 /**
656 * DEPRECATED. Conditionally resync products after applying a custom order.
657 *
658 * @since 4.4.0
659 * @param int $sorting_id ID of post dragged and dropped
660 * @param array $menu_orders Post IDs and their new menu_order value
661 */
662 public function action_sync_on_woocommerce_sort_single( $sorting_id, $menu_orders ) {
663 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->action_sync_on_woocommerce_sort_single()" );
664 return $this->products->action_sync_on_woocommerce_sort_single( $sorting_id, $menu_orders );
665 }
666
667 /**
668 * DEPRECATED. Add weight by date settings related to WooCommerce
669 *
670 * @since 4.6.0
671 * @param array $settings Current settings.
672 */
673 public function add_weight_settings_search( $settings ) {
674 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->add_weight_settings_search()" );
675 $this->products->add_weight_settings_search( $settings );
676 }
677
678 /**
679 * DEPRECATED. Conditionally disable decaying by date based on WooCommerce Decay settings.
680 *
681 * @since 4.6.0
682 * @param bool $is_decaying_enabled Whether decay by date is enabled or not
683 * @param array $settings Settings
684 * @param array $args WP_Query args
685 * @return bool
686 */
687 public function maybe_disable_decaying( $is_decaying_enabled, $settings, $args ) {
688 _deprecated_function( __METHOD__, '4.7.0', "\ElasticPress\Features::factory()->get_registered_feature( 'woocommerce' )->products->maybe_disable_decaying()" );
689 return $this->products->maybe_disable_decaying( $is_decaying_enabled, $settings, $args );
690 }
691 }
692