Archived topic
Override the default search template and use woocommerce archive-product.php
7 replies · Started by David on August 6, 2020
Hi,
how can I override the default GeneratePress search template and use WooCommerce archive-product.php template?
I want to make search results look like categories archive pages.
Thank you.
Hi there,
Try this PHP snippet:
https://docs.generatepress.com/article/generate_navigation_search_output/#woocommerce-products
Adding PHP: https://docs.generatepress.com/article/adding-php/
This only adds &post_type=product to GET request. So my URL after search contains .../?s=whattosearch&product_type=product but I need to change the whole layout of search results page and make it look products categories archives.
Hi there,
instead of using the Search Widget - use the Product Search Widget.
Hi there,
You may have a plugin or custom function preventing the default functionality.
For example, here's one of our Site Library sites: https://gpsites.co/merch/?s=ninja&post_type=product
Hello,
thank you Tom! It was caused by Disable Blog plugin (https://wordpress.org/plugins/disable-blog/).
Have a nice day.
Glad you found the issue! Thanks for letting us know :)