ga('send', 'pageview'); skip to Main Content
Controller file. $prod_name = Mage::app()->getRequest()->getParam(‘schar’); //  $model_data = Mage::getModel(‘catalog/product’)->getCollection()->addAttributeToSelect(‘name’)-> addFieldToFilter(‘name’,array(‘like’=>$prod_name.’%’)); // print_r($model_data->getData());exit; $store_id=Mage::app()->getStore()->getStoreId(); $product = Mage::getModel(‘catalog/product’); $attributes = Mage::getResourceModel(‘eav/entity_attribute_collection’) ->setEntityTypeFilter($product->getResource()->getTypeId()) ->addFieldToFilter(‘attribute_code’, ‘manufacturer’); $attributes->getSelect() ->join( array(‘attlable’=>’eav_attribute_option’), ‘additional_table.attribute_id = attlable.attribute_id’, array(‘attlable.option_id’) ); $attributes->getSelect() ->join( array(‘attlableval’=>’eav_attribute_option_value’), ‘attlable.option_id = attlableval.option_id’, array(‘*’) ) ->where(‘attlableval.value like (?)’,$prod_name.’%’) ->where(‘attlableval.store_id =’.$store_id); $data = $attributes->getData(); // echo “<pre>”; print_r($data); exit; $result=array(); foreach($data as $sdata) { $result[]=array(“data” => $sdata[‘value’],”id” => $sdata[‘option_id’]); } $this->getResponse()->setBody(Mage::helper(‘core’)->jsonEncode($result));