Merge pull request #20579 from woocommerce/fix/20554

Fix: display products on sub-subcategories when sorting parent category by price
This commit is contained in:
Claudiu Lodromanean 2018-06-20 06:00:03 -07:00 committed by GitHub
commit cff90bb3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -176,8 +176,6 @@ class WC_Query {
/** /**
* Add query vars. * Add query vars.
* *
* @access public
*
* @param array $vars Query vars. * @param array $vars Query vars.
* @return array * @return array
*/ */
@ -371,7 +369,6 @@ class WC_Query {
* *
* Hooked into wpseo_ hook already, so no need for function_exist. * Hooked into wpseo_ hook already, so no need for function_exist.
* *
* @access public
* @return string * @return string
*/ */
public function wpseo_metakey() { public function wpseo_metakey() {
@ -517,7 +514,7 @@ class WC_Query {
if ( isset( $wp_query->queried_object, $wp_query->queried_object->term_taxonomy_id, $wp_query->queried_object->taxonomy ) && is_a( $wp_query->queried_object, 'WP_Term' ) ) { if ( isset( $wp_query->queried_object, $wp_query->queried_object->term_taxonomy_id, $wp_query->queried_object->taxonomy ) && is_a( $wp_query->queried_object, 'WP_Term' ) ) {
$search_within_terms = get_terms( array( $search_within_terms = get_terms( array(
'taxonomy' => $wp_query->queried_object->taxonomy, 'taxonomy' => $wp_query->queried_object->taxonomy,
'parent' => $wp_query->queried_object->term_id, 'child_of' => $wp_query->queried_object->term_id,
'fields' => 'tt_ids', 'fields' => 'tt_ids',
) ); ) );
$search_within_terms[] = $wp_query->queried_object->term_taxonomy_id; $search_within_terms[] = $wp_query->queried_object->term_taxonomy_id;
@ -550,7 +547,7 @@ class WC_Query {
if ( isset( $wp_query->queried_object, $wp_query->queried_object->term_taxonomy_id, $wp_query->queried_object->taxonomy ) && is_a( $wp_query->queried_object, 'WP_Term' ) ) { if ( isset( $wp_query->queried_object, $wp_query->queried_object->term_taxonomy_id, $wp_query->queried_object->taxonomy ) && is_a( $wp_query->queried_object, 'WP_Term' ) ) {
$search_within_terms = get_terms( array( $search_within_terms = get_terms( array(
'taxonomy' => $wp_query->queried_object->taxonomy, 'taxonomy' => $wp_query->queried_object->taxonomy,
'parent' => $wp_query->queried_object->term_id, 'child_of' => $wp_query->queried_object->term_id,
'fields' => 'tt_ids', 'fields' => 'tt_ids',
) ); ) );
$search_within_terms[] = $wp_query->queried_object->term_taxonomy_id; $search_within_terms[] = $wp_query->queried_object->term_taxonomy_id;