Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Using OR ,AND in magento queries. 
 
senthilkumar.ms
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-12-25
Chennai-TamilNadu-India
 

hai dudes,

i have doubt in using OR in magento queries

For Example:

->addAttributeToFilter(array(array(’attribute’=>’name’, ‘like’=>’%’.$this->searchTerm.’%’),))
->addAttributeToFilter(array(array(’attribute’=>’description’, ‘like’=>’%’.$this->searchTerm.’%’),))

i want to search the product by mention the name in the textbox that is passed to the queries to select the products which having the mentioned keyword in attribute “Name” or in Attribute “description”.

but the above query only performs the AND operation

Thanks in advance

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top