Hello,
Looks like these products are attached to “Women’s Jackets” but not additionally to ?“Women’s Clothing” category.
But still you can enable the searching for these parent categories. Please use following code snippet
add_filter( 'aws_indexed_data', 'my_aws_indexed_data' );
function my_aws_indexed_data( $data ) {
if ( $data && is_array( $data ) && isset( $data['terms'] ) ) {
foreach( $data['terms'] as $source => $all_terms ) {
$term_id = 0;
if ( preg_match( '/\%(\d+)\%/', $source, $matches ) ) {
if ( isset( $matches[1] ) ) {
$term_id = $matches[1];
$source = preg_replace( '/\%(\d+)\%/', '', $source );
}
}
if ( $source === 'category' && $term_id && is_array( $all_terms ) && ! empty( $all_terms ) ) {
$term_parent = get_term( $term_id, 'product_cat' );
while ( ! is_wp_error( $term_parent ) ) {
$term_name = $term_parent->name;
$term_name = AWS_Helpers::normalize_string( $term_name );
$data['terms'][$source][$term_name] = 1;
$term_parent = get_term( $term_parent->parent, 'product_cat' );
}
}
}
}
return $data;
}
You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.
Also, after adding this code, you need to re-index the plugin table.
Regards