码迷,mamicode.com
首页 > 其他好文 > 详细

magento search except word

时间:2015-08-31 17:46:44      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

1.DB add field ‘except‘ - ‘catalogsearch_query‘
2.app\code\core\Mage\Adminhtml\Block\Catalog\Search\Edit\Form.php add field
// feng
$fieldset->addField(‘except‘, ‘text‘, array(
	‘name‘  => ‘except‘,
	‘label‘ => Mage::helper(‘catalog‘)->__(‘Except‘),
	‘title‘ => Mage::helper(‘catalog‘)->__(‘Except‘),
	‘note‘  => Mage::helper(‘catalog‘)->__(‘Except.‘),
));
3.model
app\code\core\Mage\CatalogSearch\Model\Resource\Fulltext.php
public function prepareResult($object, $queryText, $query)
{
	...
	// feng
	if($query->getExcept()){
		$likeCond .= ‘ and s.data_index not like"%‘.$query->getExcept().‘%")‘;
	}else{
		$likeCond .= ‘)‘;
	}
	...
}

magento search except word

标签:

原文地址:http://my.oschina.net/liufeng815/blog/499498

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!