将搜索字段添加到搜索栏magento

时间:2015-05-31 12:35:04

标签: php forms magento search

一位朋友让我看看他们建立的网站(长话短说,他们失败了所以网站没有完成)。左侧有一个搜索栏,有3个不同的搜索类别

Searchbox

我在form.mini.phtml中找到了它的代码

<div id="search1">
<h3>
SEARCH &gt;&gt;&gt;
</h3>
<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
<div id="label_area">
<div id="label_area">
</div>
<input type="text" name="label" id="label" value="Label &gt;&gt;&gt;" onclick="if(this.value!='Label &gt;&gt;&gt;'){ } else { this.value =''; } "size="15" class="text2">
</div>            
<div id="label_area">
<div id="label_area">
</div>
<input type="text" name="artist" id="artist" value="Artists &gt;&gt;&gt;" onclick="if(this.value!='Artists &gt;&gt;&gt;'){ } else { this.value =''; } "size="15" class="text2">  
</div>           
<div id="label_area">
<div id="label_area">
</div>
<input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" value="<?php echo $catalogSearchHelper->getEscapedQueryText() ?>" class="text2" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" /></div>
<div id="label_area"> <input type="image" src="<?php echo $this->getSkinUrl('images/go.jpg')?>" />

</div>

</form>
</div>
<!--<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
<div class="form-search">
    <label for="search"><?php echo $this->__('Search:') ?></label>
    <input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" value="<?php echo $catalogSearchHelper->getEscapedQueryText() ?>" class="input-text" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" />
    <button type="submit" title="<?php echo $this->__('Search') ?>" class="button"><span><span><?php echo $this->__('Search') ?></span></span>    </button>-->
    <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->__('Keywords>>>>>>>') ?>');
        searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
    //]]>
    </script>
 <!--  </div>
</form>-->

看起来开发人员已经将这一点融合在一起,我的问题是,如何让标签/艺术家字段工作?抱歉笨拙,我是PhP的新手,我尝试了几种没有快乐的方法,非常感谢你提前:)

0 个答案:

没有答案