Magento Search Doesn’t Work Properly

Yesterday i worked on magento searching result page, everything almost been done. But when i typed some words and tried to searh some products in demo sotre, 50 products at least came out on the page, but there was none related with the keywords i typed in the search blank, that’s really weird!
Re-indexed all data and clear cache, but nothing changed!
I checked all relevant template files, finally found that, i comment folling lines in catalogsearch.xml
path: app\design\frontend\your_template\your_theme\layout\

 
<reference name="left">
   <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>

Just un-comment or add these lines in catalogsearch.xml, everthing goes right again!

Magento Contact Form 不能发送邮件

今天在给客户调试域名邮箱时发现Contact Form怎么都无法将信息发送到域名邮箱,但是Contact Form信息提交之后依旧显示“Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.“,如果将邮件箱地址改为gmail,hotmail或者其它免费邮箱却能接收成功。

打开app/design/frontend/themedirectory/template/contacts/form.phtml 检查 form action,发现action为空,将如下代码:

<form id="contactForm" action="<?php echo $this-><br />getFormAction(); ?>" method="post"></form>

更改为:

<form id="contactForm" action="<?php echo $this-><br />getUrl('contacts/index/post'); ?>" method="post"></form>

清空缓存,再测试,一切正常!

Magento如何更改产品分类页面布局

如果需要同时更改Magento所有分类页面的布局结构,可以采用如下方法:

在当前使用的magento模板路径下,如app/design/frontend/yourtheme(your_package)/default(your_theme)/layout/ 新建local.xml文件,然后填写一下代码,清空缓存即可看到效果。

以下代码中的2columns-left.phtml可以改成其他的默认的布局文件或者用户自定义的布局。

<?xml version="1.0"?>
<layout version="0.1.0">
<default>
</default>
<catalog_category_default>
  <reference name="root">
    <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
  </reference>
</catalog_category_default>
</layout>

以上通过新建local.xml更改magento布局的方法优点在于,无需更改默认的布局文件,并且所有的布局(layout)更新都集中于一个文件当中,后期模板的维护和更新都比较方便。

当然缺点也存在,可能略微影响模板文件的调用速度,我个人觉得这种影响可以忽略不计。