• Resolved hardigi

    (@hardigi)


    Hi

    i’m having a problem adding the function woo_predictive_search_widget() to the header.

    It is being used as follows…
    $header_output .= '<div class="span5">'.woo_predictive_search_widget().'</div>'. "\n";

    But I think the code is echoing rather than returning. This means the search bar is being output at the top of the page (rather than inside the div tags).

    Instead, it is blank inside the div tags, like this…
    <div class="span5"></div>

    Any suggestions please?

    https://www.ads-software.com/plugins/woocommerce-predictive-search/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hardigi

    (@hardigi)

    Ok. Think I’ve fixed it but would appreciate if plugin author could double check this for me.

    In PRO version of plugin I’ve changed line 174 of wc-predictive-search-init.php FROM…

    else $show_price = 0;
    	echo WC_Predictive_Search_Widgets

    TO…

    else $show_price = 0;
    	return WC_Predictive_Search_Widgets

    Is this ok? It seems to work. Will it cause me any probs elsewhere on site?

    Thread Starter hardigi

    (@hardigi)

    Resolved! The plugin author kindly checked this and agreed that return would work fine.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display problems in Header – echo rather than return?’ is closed to new replies.