Add post_excerpt to product search

This commit is contained in:
Mike Jolley 2018-03-15 11:21:27 +00:00
parent c4b3bd0114
commit 3df5a479f9
1 changed files with 3 additions and 1 deletions

View File

@ -701,7 +701,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$value = '';
delete_transient( 'wc_layered_nav_counts_' . $attribute_key );
if ( is_null( $attribute ) ) {
if ( taxonomy_exists( $attribute_key ) ) {
// Handle attributes that have been unset.
@ -1354,6 +1354,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
$type_join
WHERE (
posts.post_title LIKE %s
OR posts.post_excerpt LIKE %s
OR posts.post_content LIKE %s
OR (
postmeta.meta_key = '_sku' AND postmeta.meta_value LIKE %s
@ -1365,6 +1366,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
ORDER BY posts.post_parent ASC, posts.post_title ASC",
$like_term,
$like_term,
$like_term,
$like_term
)
// phpcs:enable