-
Author
-
October 5, 2015 at 14:31 #80888AyoadeParticipant
I am building my homepage, and I use the KLEO search form for users to search for products, forums etc.
However, the search for products returns result showing the name of the seller and excerpt whereas I expect to see the product name, price and shop owner (using WC Vendors Plugin).
Can I make the result look like what woocommerce search button gives?
October 5, 2015 at 16:18 #80909sharmstrModeratorProducts are basically just posts. At the moment, Kleo treats them as such. That’s why you are seeing the excerpts. I’ll see if I can come up with something that can be added to the core code. At the very least add a View All Results button that’s specific to products so it will append “&post_type=product” to the search url (that’s what the woo search widget does). It may take some time, so please be patient
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 03:53 #81199sharmstrModeratorJust a heads up. After tomorrow I’ll be out for a week. Not sure I’ll be able to get to this before I leave.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 14:44 #81274AyoadeParticipantI am looking at trying a plugin like Instant search for Woocommerce or Woocommerce Predictive search; but I am worried about the speed of my site.
Will you be able to help improve the speed when I’m done?
October 7, 2015 at 14:50 #81277sharmstrModeratorNo. Sorry.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 14:56 #81279sharmstrModeratorBut… if you do find a plugin that you like and you’d like kleo to officially support it, you can open up a topic in the Feature Request forum to have it voted on.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 16:05 #81302AyoadeParticipantSorry, I am taking you back.
When will you have time to write the code? I’m trying to avoid using too many plugins. I think that’s the best option for me right now.
When users click view all results (for products), let it take them to the products page.
Thanks for helping.
October 7, 2015 at 16:06 #81303sharmstrModeratorProbably not until I get back next week. I have a bunch of requests that I’m trying to solve before I leave. 🙂
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 16:24 #81306AyoadeParticipantNext week is fine for me. I will be waiting. Thanks really!
October 7, 2015 at 16:50 #81310sharmstrModeratorThis is a bit of a hack. The search in the main menu and the vc shortcode uses the same function. So its best to keep your search context options short (i.e. products and posts or products and members) or the list could get quite long and not show all of the ajax results if the page isnt long enough. Also, this will not stop WP from showing products in the “all results” search results so its best to set the shortcode to “Just AJAX results” for the form type. That will disable the form from submitting if someone hits the enter key. They are then forced to click on “View Product Results” which will take them to the correct results page.
Anyhow, put the attached function in your child theme’s functions.php file.
I can tell you that this code will not make it into Kleo the way I’ve written it. It needs to be coded better, so keep an eye out in future updates for either a change to this function that doesnt include product results page OR the inclusion of product results, in which case you can remove this function from your child theme.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.October 7, 2015 at 17:21 #81325AyoadeParticipantI have added it but I’m still getting post type, showing name and excerpts.
October 7, 2015 at 17:29 #81327sharmstrModeratorYou will get that if you click “View All Results” because that will take you to the default wp search results page. If you click on “View Product Results” you’ll go to the product results page. The difference in the urls are
http://www.yoursite.com/?s=yoursearchtext and http://www.yoursite.com/?s=yoursearchtext&post_type=product
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 17:30 #81328sharmstrModeratorLets be perfectly clear. I didnt change the layout of the ajax list. I only change the search results landing page.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
October 7, 2015 at 17:32 #81329sharmstrModeratorsee difference
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.October 10, 2015 at 07:47 #81680AyoadeParticipantHey Sharmstr …you did an excellent job for me. I didn’t know I had to upload via ftp directly to the functions.php file. I tried using the editor in my appearance menu; and the first time didn’t work while the second time gave me white screen.
But now, it’s working perfectly …upload via ftp.
Thank you so very much.
November 23, 2015 at 13:14 #88608AyoadeParticipantHi Sharmstr,
Once again, thank you for this hack.
(1) Can you help modify it such that when a user hits enter, it will show only products result.
(2) Secondly, I noticed that the ajax search function stops if the user creates a space after the search term (using the regular space button on the keyboard). Is there a way to make the search continue despite the space?
February 18, 2016 at 20:04 #104828amonroeParticipant@sharmstr
Thank you for writing this bit of code ( kleo-search.txt ) for the other member here. I am finding it very useful for my site, as I definitely wish for the product searches to appear as product results display. It works perfectly, with one exception:When used, the KLEO WIDGET for RECENT POSTS that I have in my footer also shows search results … I have the widget set to only show 3 or 4 posts, but suddenly after a search is run for a product, the products show in the widget as well, and many more than 3 or 4 posts.
Would you have any idea for an adjustment that may prevent this from occurring?
Thank you for any time you could spare to help me with this, if possible.
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.