Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created November 12, 2019 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/fe96fe74b39f679d8c1d37868441df8e to your computer and use it in GitHub Desktop.
Save mgibbs189/fe96fe74b39f679d8c1d37868441df8e to your computer and use it in GitHub Desktop.
FacetWP - ignore WP Product Bundles query (when added to cart)
<?php
// Add the following to your (child) theme's functions.php
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( 'product' == $query->get( 'post_type' ) && 'product_query' != $query->get( 'wc_query' ) ) {
$is_main_query = false;
}
return $is_main_query;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment