Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Проблемы с поиском


Virtuozzo
 Share

Recommended Posts

Добрый вечер! Недавно возникла проблема с поиском при вводе товара, товар нахоидт, показывает, всё хорошо. Но когда нажимаешь "Найти" в адерсную страку после домен.ру/ подставляется > сивол и поиск выдает ошибку.

Из файла /catalog/view/theme/тема/template/common/header.tpl

	var selector = '#search';
	var total = 0;
	var show_image = 'true';
	var show_price = 'true';
	var search_sub_category = true;
	var search_description = false;
	var width = 62;
	var height = 62;

	$(selector).find('input[name=\'search\']').autocomplete({
		delay: 500,
		source: function(request, response) {
			var limit = 5;
			var search_sub_category = search_sub_category?'&sub_category=true':'';
			var search_description = search_description?'&description=true':'';
			$.ajax({
				url: 'index.php?route=module/pavautosearch/autocomplete&width='+width+'&height='+height+'&limit='+limit+search_sub_category+search_description+'&filter_name='+encodeURIComponent(request.term),
				dataType: 'json',
				success: function(json) {		
					response($.map(json, function(item) {
						if($('.pavautosearch_result')){
							$('.pavautosearch_result').first().html("");
						}
						total = 0;
						if(item.total){
							total = item.total;
						}
						return {
							price: item.price,
							label: item.name,
							image: item.image,
							link:  item.link,
							value: item.product_id
						}
					}));
				}
			});
		},
		select: function(event, ui) {
			return false;
		},
		focus: function(event, ui) {
	      	return false;
	   	}
	})

 

 

		<div id="search">
			<!--<div class="button-search"></div>-->
			<!--<div class="button-search2"></div>-->
			<input class="search-field" type="text" name="search" placeholder="Поиск по сайту" value="<?php echo $search; ?>" id="mysearch">
			<button class="button-search-delete"></button>
			<button class="button-search2">Найти</button>
			<script>
				function DeleteRender(){
					if($('.search-field').val()==''){
						$('.button-search-delete').css('display', 'none')
					}
					else{
						$('.button-search-delete').css('display', 'block')
					}
				}
				window.onload = function(){
					DeleteRender()
				}
				$('.search-field').on('keyup', function(){
					DeleteRender()
				})
				$('.button-search-delete').on('click', function(){
					$('.search-field').val('')
					$('.search-field').focus()
					$('.button-search-delete').css('display', 'none')
				})
			</script>
		</div>
	  </div>

Лишних символов > не нашел. Где еще можно поискать проблему или как решить?

Безымянный.png

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.