Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1001648
    tlord11
    Participant

    I am using the X theme for a woocommerce store. I really like the search box in the main navigation menu, it is something my customers are going to enjoy. However, when I type a search term into the box, it returns all items on the site containing the keyword. This is a poor user experience as it returns a variety of image files and worst of all the spreadsheets of items that I’ve imported. I want the search results to only include products, not any other files/pages. I have been able to create this search feature elsewhere on my site using the YITH WooCommerce Ajax Product Search widget, but I can’t figure out how to manipulate the navbar search to yield the same results. It seems like there should be a solution, maybe via custom CSS? Any help would be much appreciated.

    #1001924
    Rahul
    Moderator

    Hi there,

    Unfortunately, Woocommerce isn’t covered by our capability as support. I don’t know other option to use for product search except the widget. I can only give you some advice.

    But if you already have the widget in place and need help with CSS, we’d be happy to assist.

    Thanks!

    #1001955
    tlord11
    Participant

    I do have the widget, but I’m not sure it is even that complicated. Basically, when I type a keyword into the navbar search box the URL that returns is http://mysite.com/?s=keyword – what I want it to do is return the URL http://mysite.com/?s=keyword&post_type=product.

    Can you point me in the direction of the file I need to alter in order to make this happen?

    #1001970
    Rahul
    Moderator

    Hi Ben,

    Search template is only applicable for built-in post types that comes with X. Though I agree that product should have its own search result page, but that should be different since product post type different structure than the other post types. Hence, builtin search feature is not suitable for product searches. In fact there is a extension for that utilize the structure of a product and woocomemrce, like from here https://docs.woothemes.com/document/woocommerce-product-search/

    By default X doesn’t have search template file, you can either create one (http://codex.wordpress.org/Creating_a_Search_Page) or you can make editing in wp-content/themes/x/framework/views/global/_index.php.

    And since woocommerce uses different templates, it has to be attached to search template too. And we can’t cover woocommerce template development this time. But as discussed above, I’ll just add this as a feature request 🙂 , we support can’t simply provide complete customisation from scratch.

    Thanks for understanding.

    #1001990
    tlord11
    Participant

    I’ll keep tinkering with it, I can usually solve stuff like this. Thanks for trying!

    #1002432
    Darshana
    Moderator

    You’re welcome 🙂

  • <script> jQuery(function($){ $("#no-reply-1001648 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>