Answer the question
In order to leave comments, you need to log in
Why is opencart search not working?
I can’t find the reason, the search in the header on the site
doesn’t work somewhere in js, but I just can’t understand why, when entering a search phrase, it doesn’t transfer to the search result, that is
, when you press the search button or enter, it leads to an empty search page,
although , if you enter a query on the search page below, in a different form, everything works
here is the default template search.tpl
<div id="search" class="input-group">
<input type="text" name="search" value="<?php echo $search; ?>" placeholder="<?php echo $text_search; ?>" class="form-control input-lg" />
<span class="input-group-btn">
<button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
</span>
</div>
$("#form-language").submit()}),$("#search input[name='search']").parent().find("button").on("click",function(){var a=$("base").attr("href")+"index.php?route=product/search",b=$("input[name='search']").val();b&&(a+="&search="+encodeURIComponent(b));var c=$("select[name='category_id']").val();c>0&&(a+="&category_id="+encodeURIComponent(c),a+="&sub_category=true"),location=a}),$("#search input[name='search']").on("keydown",function(a){13==a.keyCode&&$("input[name='search']").parent().find("button").trigger("click")}),
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question