ResolvedCustomise search results page
- This topic has 4 replies, 2 voices, and was last updated 2 years, 5 months ago by
Althemist.
- AuthorPosts
- January 30, 2021 at 3:51 pm #28619
raoul_k@hotmail.co.uk
ParticipantI want to change my search results page after a customer searches for a product using the product search form. Currently when a customer searches for products using this form, e.g. the customer enters ‘apples’, they are taken to the search results page which shows all the products with ‘apples’ in the name, category or tag. e.g. ‘red apple’, ‘green apple’.
I want to change this page to return the list of products AND the primary category that product is in. E.g. if someone searches for ‘apples’, the search results page returns the primary category ‘fruit’ and then the products below ‘red apple’, ‘green apple’.
I can’t seem to find any way to change the search results page without needing to write php and modify my theme’s search.php file. Is there any other way to customise the search results page?
Thank you!
January 30, 2021 at 4:15 pm #28620raoul_k@hotmail.co.uk
ParticipantI may be able to resolve this with a custom search results template. Do you know how I can create one? Thanks again.
February 1, 2021 at 10:59 am #28634Althemist
KeymasterHello raoul_k@hotmail.co.uk,
I am afraid that would not be possible and it’s not theme related. It’s just how the WordPress and WooCommerce search work. It can’t be done with a change of the template. May be you should search for a plugin with such functionality, but to be completely honest, I don’t really think what you need can be done with WooCommerce.
June 8, 2021 at 2:45 pm #30631raoul_k@hotmail.co.uk
ParticipantHi there,
I understand the search results page is driven by the archive-product.php file. If I was to create a new template, would I be able to show product search results on a custom page? This would make the search results page look much better and more consistent with the rest of the website.
Thanks!
June 9, 2021 at 6:51 pm #30649Althemist
KeymasterNo, I am afraid that would not be possible. As I already explained, the only option would be a third-party search plugin, but I am not sure if it would work the way you want.
- AuthorPosts
You must be logged in and have valid license to reply to this topic.