Jump to content

Search results ordering in Prestashop 1.7


Recommended Posts

Hello,

I'm facing a problem with search results in Prestashop 1.7. They are ordered by default by relevance in asc way. This is not good. It means first is the least relevance. How can I change that behaviour ?

Thank you !

Manue

 

Link to comment
Share on other sites

For anyone intersting in that, I found a way.

I added on my /themes/YOURTHEME/modules/ps_searchbar/ps_searchbar.tpl an hidden input

<div id="search_widget" class="col-lg-4 col-md-5 col-sm-12 search-widget" data-search-controller-url="{$search_controller_url}">
	<form method="get" action="{$search_controller_url}">
		<div class="input-group">
			<span class="input-group-btn">
				<button class="btn btn-default buttonsearch" type="submit">
					<span class="searchbutton"></span>
				</button>
			</span> 
			   <input type="hidden" name="controller" value="search">
                    <!-- ADDED TO ALTER THE ORDER -->
			   <input type="hidden" name="order" value="product.position.desc">
                    <!-- END OF NEW INPUT -->
			   <input id="input-field-id" class="form-control" type="text" name="s" value="{$search_string}" placeholder="{l s='Search our catalog' d='Shop.Theme.Catalog'}">
				
		</div>
	</form>
</div>
  • Like 4
Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...