# Sage 9 and searchwp ajax template loading?

**URL:** https://discourse.roots.io/t/sage-9-and-searchwp-ajax-template-loading/16943
**Category:** sage
**Tags:** sage9
**Created:** 2019-10-31T12:18:10Z
**Posts:** 3

## Post 1 by @the_lar — 2019-10-31T12:18:11Z

I’m working on a woocommerce site which uses Sage, I’m also using relevanssi search plugin together with [SearchWP live ajax](https://wordpress.org/plugins/searchwp-live-ajax-search/)

Similarly to woocommerce, SearchWP Live Ajax allows you to override the template by (normally) creating `searchwp-live-ajax-search/search-results.php` in the theme folder. However in Sage, this doesn’t work, I tried recreating the file at `resources/views/searchwp-live-ajax-search/search-results.blade.php`, but that doesn’t work. I did convert all the php from the template in the plugin templates directory to blade:

```
@php
/**
 * Search results are contained within a div.searchwp-live-search-results
 * which you can style accordingly as you would any other element on your site
 *
 * Some base styles are output in wp_footer that do nothing but position the
 * results container and apply a default transition, you can disable that by
 * adding the following to your theme's functions.php:
 *
 * add_filter( 'searchwp_live_search_base_styles', '__return_false' );
 *
 * There is a separate stylesheet that is also enqueued that applies the default
 * results theme (the visual styles) but you can disable that too by adding
 * the following to your theme's functions.php:
 *
 * wp_dequeue_style( 'searchwp-live-search' );
 *
 * You can use ~/searchwp-live-search/assets/styles/style.css as a guide to customize
 */
@endphp

@if ( have_posts() )
  @while(have_posts())
    @php the_post() @endphp
    @php
      $post_type = get_post_type_object( get_post_type() );
    @endphp
    <div class="searchwp-live-search-result" role="option" id="" aria-selected="false">
      <p><a href="{{ esc_url( get_permalink()) }}">aaa {{ the_title() }} &raquo;</a></p>
    </div>
  @endwhile
@else
  <p class="searchwp-live-search-no-results" role="option">
    {{ esc_html_e( 'No results found.', 'swplas' ) }}
  </p>
@endif
```

I guess there’s something I need to do to make it work properly, I’m using this package for woocommerce - [https://github.com/roots/sage-woocommerce](https://github.com/roots/sage-woocommerce), which I think is what does the same thing for woocommerce templates (but I’m not certain)?

---

## Post 2 by @the_lar — 2019-10-31T12:45:29Z

I’m going to answer my own question here, I just copied the file to `resources/searchwp-live-ajax-search/search-results.php` and found I was able to edit it there.

---

## Post 3 by @system — 2019-12-12T12:25:52Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
