Product Icon

WooCommerce Product Search

Trending
The perfect Search Engine helps customers to find and buy products quickly – essential for every WooCommerce store.

Product search shortcode simple integration with shop widget search

Shortcode [woocommerce_product_search] uses ?s=input1 query param, but shop widget product search does not clear this search attribute. It then adds a second search param ?ixwpss=input2

Therefor, if the shortcode is used first, then the shop product search is used, the search terms are combined and result in “no results” when there should be results.

In version 2.0.0 of file:
/wp-content/plugins/woocommerce-product-search/lib/views/class-woocommerce-product-search-filter.php:215

$current_url = remove_query_arg( array( ‘ixwpss’, ‘title’, ‘excerpt’, ‘content’, ‘categories’, ‘attributes’, ‘tags’, ‘sku’, ‘lang’, ‘paged’ ), $current_url );

Could be changed to:

$current_url = remove_query_arg( array( ‘s’, ‘ixwpss’, ‘title’, ‘excerpt’, ‘content’, ‘categories’, ‘attributes’, ‘tags’, ‘sku’, ‘lang’, ‘paged’ ), $current_url );

This change in the plugin file in my local environment resulted in the shortcode and the shop widget to be compatible.

Screenshots

Author

Corey

Current Status

Open

Last updated: November 15, 2024

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.