Need some PHP help…
-
Okay so I am trying to integrate a new woocommerce search plugin (‘predictive search for woocommerce’) and am mostly having issues with combining the PHP with html being echoed from php… if that makes any sense.
So here’s what I got from the plugin author: They say to put this code on your header.php file
<?php $ps_echo = true ; if ( function_exists( 'woo_predictive_search_widget' ) ) woo_predictive_search_widget( $ps_echo ); ?>
and to remove any existing search functions. I can do that and the search bar works, it just does not display where I want it. I want it within the menu to the left of the cart icon.
I have found in my header-models.php file where that code is pulled and have attempted to integrate the php snippet into it somewhat like this:
$header_return .= ‘ <div id=”main-nav-bg” class=”nav-box”> <div class=”row”> <div class=”large-12 columns quasar-nav-fixed-ready”> ‘.quasar_get_nav_menu(false).’ ‘.$ps_echo = true ; if ( function_exists( ‘woo_predictive_search_widget’ ) ) woo_predictive_search_widget( $ps_echo );’ </div> </div><!– Clear any unwanted alignment from menu–> </div> <div class=”nav-shadow-container”> ‘.$menu_shadow.’ </div>’;
My theme author suggests I directly replace the search function from the functions.php file, which creates the default search function, but I again am having no lucking integrating the new code into this:
$search_icon = ' <div class="special-search-container"> <i class="fa fa-search"></i> <div class="special-search-overlay-box padding"> <form role="search" method="get" id="searchform" class="searchform" action="'. home_url( '/' ).'"> <div> <input type="text" value="" name="s" id="s" placeholder="'.__('Search for:','quasar').'"> <input type="submit" class="button buttom-custom" id="searchsubmit" value="'.__('Search','quasar').'"> </div> </form> </div> </div> ';
Obviously I am not much a programer so any help or advise here would be greatly appreciated.
In case it helps here is the site in question: https://trautmantraining.com/ FYI the magnifying glass, slide out search bar is the one to be replaced. I will notify on this thread as soon as I get this figured out.
- The topic ‘Need some PHP help…’ is closed to new replies.