Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Не рилииет кнопка поиска при нажатии на Enter


 Share

Recommended Posts

Форумчане, икая проблема, может кто-то и уже ее решал...

 

В стоке "ПОИСК" при нажатии на "ENTER" выкидывает на страницу "запрашиваемая страница не найгдена" .... куда посмотреть...

 

/* Search */
    $('#search input[name=\'search\']').parent().find('button').on('click', function() {
        var url = $('base').attr('href') + 'index.php?route=product/search';

        var value = $('input[name=\'search\']').val();

        if (value) {
            url += '&search=' + encodeURIComponent(value);
        }

        location = url;
    });

    $('#search input[name=\'search\']').on('keydown', function(e) {
        if (e.keyCode == 13) {
            e.preventDefault();
            $('header input[name=\'search\']').parent().find('button').trigger('click');
        }
    });

 

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>

 

Link to comment
Share on other sites


4 hours ago, Andrey555 said:

В стоке "ПОИСК" при нажатии на "ENTER" выкидывает на страницу "запрашиваемая страница не найгдена" .... куда посмотреть...

начните с консоли браузера. обращать внимание на налилие каких-липотому что редиректов после нажатия ентера + напишите нам итоговый url, по которому собственно "не найгдено".

вероятно, проблема связана с чпу\сео_про\.htaccess или банальным кэшем.

Link to comment
Share on other sites

  • 3 weeks later...

ищите как именно он подключается, возможно в сам шаблон встроен

 

пробуйте сам файл переименовать в livesearch.js_

потом обновите кеш браузера Ctrl+F5 и проверьте

если нормально бугдет рилиить по нажатию - зналит точно прилина в конфликте скриптов

Link to comment
Share on other sites

врогде все полулилось... спасипотому что за подсказку!

 

Если можно то еещё вопрос, использую мультиязык от Марка, и ггде есть города, то в поиске подсивляется "слешь "/" откуда берется всю голову сломал.. 

 

https://prnt.sc/w2fouc

 

 

Link to comment
Share on other sites


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
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.