Behavior for product and categories

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 nemanja 5 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10494
    nemanja
    nemanja
    Participant

    I would like to add categories in search results beside products
    ?s={phrase}&post_type=product
    What should I add?

    Regards

    #10495
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #10505
    nemanja
    nemanja
    Participant

    Hi,

    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

    #10520
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    “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.png

    To 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.png

    Don’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&param1=value1&param2=value2&param3=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 :)


    #10521
    nemanja
    nemanja
    Participant

    OK, thanks for your reply.

    • This reply was modified 5 years, 8 months ago by nemanja nemanja.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.