Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Behavior for product and categories
This topic contains 4 replies, has 2 voices, and was last updated by nemanja 7 years, 1 month ago.
- AuthorPosts
- October 17, 2016 at 3:05 pm #10494
I would like to add categories in search results beside products
?s={phrase}&post_type=product
What should I add?Regards
October 17, 2016 at 3:09 pm #10495Hi!
As far as I know, it’s not possible to display them on the WooCommerce search results page (redirection to “?s={phrase}&post_type=product”).
Unfortunately that page is managed by WooCommerce/Theme and I have not yet seen any WooCommerce theme capable of displaying other than products there.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 18, 2016 at 11:31 am #10505Hi,
Thanks for your quick answer.
I just want to list all products inside some category or subcategory, not to show category by name.
It is possible to list products through autocomplete, but not on return key behaviour.What is this for? https://wp-dreams.com/knowledge-base/how-to-add-variables-to-the-redirect-to-url-or-the-show-more-url/
Don’t get what are “param1” => “value1” for. Could I set anything there?
Regards
October 19, 2016 at 10:52 am #10520Hi!
“I just want to list all products inside some category or subcategory, not to show category by name.”
If you want only product results, but not the product categories as results, then make sure everything is disabled on the General Options -> Sources 2 panel: https://i.imgur.com/Cy5Mkd5.pngTo include items from a specific sub-category, you can use the include option on the Advnaced Options -> Exclude reuslts panel: https://i.imgur.com/9tM0Wf8.png
“It is possible to list products through autocomplete, but not on return key behaviour.”
If you mean like not triggering the ajax search on hitting the return key, you can configure that on the General Options -> Behavior panel: https://i.imgur.com/nJ6qmOt.pngDon’t get what are “param1” => “value1” for. Could I set anything there?
This is when you have redirection activated when hitting the return button or the magnifier icon. This code allows you to pass additional query (GET) parameters if you need it. It’s mostly for developers use. In the example the $value array is set as following:$values = array( "param1" => "value1", "param2" => "value2", "param3" => "value3" );
This will result in a redirection from this:
yoursite.com/s?=test
to:
yoursite.com/s?=test¶m1=value1¶m2=value2¶m3=value3
I do not recommend using that, unless you have a reason to do so.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 19, 2016 at 12:44 pm #10521 - AuthorPosts
You must be logged in to reply to this topic.