I have an issue with the XStore theme and WooCommerce product search / shop page.
This URL works correctly and shows product search results: https://maanu.pl/?s=szampon&et_search=true&lang=pl
It displays the standard XStore product archive layout with many matching products.
If I switch to a default theme like Twenty Twenty-Five, product search works fine as well.
What is broken
As soon as I add post_type=product to the query string, XStore shows “No products found”: https://maanu.pl/?s=szampon&post_type=product&et_search=true&lang=pl
On other themes this URL behaves as expected and returns matching products, but on XStore it returns an empty result, even though products clearly exist for that search term.
Additionally, my main shop page (WooCommerce shop archive) also stopped showing products. It used to work before. When I switch to another theme, the shop page displays products again, so it seems theme-related.
So With XStore:
?s=szampon&et_search=true&lang=pl → works
?s=szampon&post_type=product&et_search=true&lang=pl → no products found
Shop page → no products shown (used to work)
With another theme (e.g. Twenty Twenty-Five):
Both URLs and the shop page show products correctly.
What I’ve checked so far: I have a child theme, but my custom functions.php does not modify WooCommerce queries.
add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘custom_woocommerce_get_catalog_ordering_args’ );
function custom_woocommerce_get_catalog_ordering_args( $args ) {
if ( ! is_search() ) {
$orderby_value = isset( $_GET[‘orderby’] ) ? wc_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
if ( ‘random_list’ == $orderby_value ) {
$args[‘orderby’] = ‘rand’;
$args[‘order’] = ”;
$args[‘meta_key’] = ”;
}
}
return $args;
}
and it works.