• Resolved savassigames

    (@savassigames)


    Hello! How are you today?

    Searching by sku isn’t working on my page, is there some code I should insert or something?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter savassigames

    (@savassigames)

    Just noticed is something related to my search box. When using a shortcode, it works just fine.

    My test page for reference: https://savassigames.com.br/testes-de-shortcodes/

    The last search plugin I used had a functions.php code to replace the theme search with their box, maybe you have something like that I could use? Here’s their code:

    add_filter( 'aws_js_seamless_selectors', 'aws_js_seamless_selectors' );
    function aws_js_seamless_selectors( $selectors ) {
    $selectors[] = 'form.hw-search';
    return $selectors;
    }

    Thanks again!

    Plugin Author YummyWP

    (@yummy-wp)

    Hello,

    to search by SKU you should enable the appropriate setting in the “Items to search through” tab for the Smart Search widget #1
    https://www.wpsmartsearch.com/docs/content-types/#2-toc-title

    There is no option to set custom selector via WP filter, but it’s a good idea and I’ll add this feature shortly.

    Thank you!

    Thread Starter savassigames

    (@savassigames)

    I see, thank you so much, though!

    Glad I could give some good idea, then!

    Thread Starter savassigames

    (@savassigames)

    Also, if someone comes around with the same issue til this feature is implemented, my solution was to add it as a shortcode to my header menu and then ajust it using custom css! I’m pretty happy with the results tbh.

    Plugin Author YummyWP

    (@yummy-wp)

    The filter has been added in the latest plugin release:

    add_filter( 'sws_search_bar_css_selectors', 'sws_search_bar_css_selectors', 10, 2 );
    /**
    * @param $selectors array - css selector of the <form> element
    * @param $widget_id int - id of the Smart Search widget that you set up [1|2|3...]
    *
    * @return mixed
    */
    function sws_search_bar_css_selectors( $selectors, $widget_id ) {
    if ( $widget_id === 1 ) {
    $selectors[] = 'form.header-search-bar';
    }


    return $selectors;
    }

    https://www.wpsmartsearch.com/docs/hooks-filters/#9-toc-title

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.