首先,我不是开发人员。我们的Magento网站没有专门的开发人员。几天前,我的老板让我在网站上修正了一个错误。发生的事情是搜索按钮不起作用。我试着点击它,没有任何反应。当我进入Inspect Element时,控制台出错。它在prototype.js:5557中说“Uncaught TypeError:无法读取属性'获取'未定义”。
我已经尝试了一切我能想到的解决方法。说实话并不是很多。我重新编制了索引文件,清除了缓存,更新了Magento,并确保按钮位于应有的位置。我确保可以在Magento中搜索产品,并确保搜索类型设置为like / fulltext。我认为它可能是代码中的错误,但我不知道要编辑什么或在哪里。我疯了,试图解决这个问题。
商店的链接是:http://store.excitementvideo.net/但请记住它是NSFW。
谢谢
更新:我被告知其表单错误?这是我的form.mini.phtml文件
<form id="search_mini_form" action="<?php echo $this->helper('catalogsearch')->getResultUrl() ?>" method="get">
<div class="form-search">
<label for="search"><?php echo $this->__('Search:') ?></label>
<form> <input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>" class="input-text" /></form>
<form><button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span></button></form>
<div id="search_autocomplete" class="search-autocomplete"></div>
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
searchForm.initAutocomplete('<?php echo $this->helper('catalogsearch')->getSuggestUrl() ?>', 'search_autocomplete');
//]]>
</script>
</div>
</form>
答案 0 :(得分:0)
看起来javascript对字符串部分有轻微的错误。
尝试更改
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search entire store here...') ?>');
searchForm.initAutocomplete('<?php echo $this->helper('catalogsearch')->getSuggestUrl() ?>', 'search_autocomplete');
//]]>
</script>
到
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__("Search entire store here...") ?>');
searchForm.initAutocomplete('<?php echo $this->helper("catalogsearch")->getSuggestUrl() ?>', 'search_autocomplete');
//]]>
</script>