Jump to content
Sign in to follow this  
Virtuozzo

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

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

Share this post


Link to post
Share on other sites

Ищите в контроллере либо в модификациях

Share this post


Link to post
Share on other sites

Проблема решена. Косяк был в подключаемом common.js строка 53

Edited by Virtuozzo

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.