• Resolved charlie101

    (@charlie101)


    I’ve installed this plugin because I only wanted to show a certain category on the main shop page (homepage.) However, after doing this, I noticed that the main product search only searches for the category I selected to appear on the front page. I still want the product search (?s=SEARCHTERM&post_type=product) to return results from all categories.

    The general site search (?s=SEARCHTERM) still works as normal.

    Any help?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author disespubli

    (@disespubli)

    Hi Charlie101,

    First of all Thanks for using Woo Shortcodes Kit!

    Actually the functions to display or hide products use the condition is_shop(), then the categories are “removed” in the shop page but too for the product search form results.

    But if you need, i can help you to solve it, just contact me from the WSHK website and i will send you it modified or if you know modify code i can tell you how to solve it easily.

    In the next WSHK version 1.9.0 it will be enhanced and the function will let you choose where you want to hide it.

    Regards!

    Thread Starter charlie101

    (@charlie101)

    I’m pretty comfortable modifying PHP so you can let me know on here – thanks.

    Plugin Author disespubli

    (@disespubli)

    Great,

    Then you can look intro the woo-shortcodes-kit > functions folder and open the file “wshk-customize-shop-page.php

    Case 1: Function “Show only products from specific categories on the shop page”
    Go to the line 22 and after is_shop() add this: && ! is_search()

    Case 2: Function “Exclude products from specific categories on the shop page”
    Go to the line 58 and after is_shop() add this: && ! is_search()

    EXAMPLE: && is_shop() && ! is_search()

    Save the changes and check your products search form.

    Hope it can be helpful, if you have any doubt about please let me know it and i will help you.

    Regards!

    Thread Starter charlie101

    (@charlie101)

    Cheers. Worked.

    Plugin Author disespubli

    (@disespubli)

    Great,

    Then i will mark it as resolved.

    Regards!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Setting categories to shop page restricts search’ is closed to new replies.