Subversion Repositories SmartDukaan

Rev

Rev 20139 | Rev 20243 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20139 Rev 20237
Line 532... Line 532...
532
			}
532
			}
533
		}
533
		}
534
		$noscrolling = true;
534
		$noscrolling = true;
535
		$this->set(compact('deals','id','noscrolling'));
535
		$this->set(compact('deals','id','noscrolling'));
536
	}
536
	}
-
 
537
	
-
 
538
		
-
 
539
	public function autosuggest($ser){
-
 
540
		$ser = $this->request->query('term');
-
 
541
		
-
 
542
// 		$res= '[{ "value": "Afghan afghani", "id" : "hello"},{ "value": "Albanian lek","id" : "hello" },{ "value": "Algerian dinar" ,"id" : "hello"}]';
-
 
543
		$this->autoRender = false;
-
 
544
		$this->request->onlyAllow('ajax');
-
 
545
		
-
 
546
		$url ="http://shop2020.in:8080/dtr/solr-search!getSuggestions?search_text=".urlencode($ser);
-
 
547
		$res = $this->make_request($url, null);
-
 
548
		return json_encode($res);
-
 
549
		
-
 
550
	}
-
 
551
	
-
 
552
	public function newsearch(){
-
 
553
		$q = $this->request->query('q');
-
 
554
		$this->layout = 'innerpages';
-
 
555
		$page =2;
-
 
556
// 		$noti='[{"title": "Riviera Series J Battery For Micromax A240","id": "28750"}]';
-
 
557
// 		$result = json_decode($noti,1);
-
 
558
 
-
 
559
		$url = "http://shop2020.in:8080/dtr/solr-search!getSearchResults?search_text=".urlencode($q)."&offset=0";
-
 
560
		$result = $this->make_request($url, null);
-
 
561
		$nexturl = "/store_products/nextsearch?page=".$page."&search_text=".urlencode($q);
-
 
562
		$this->set(compact('result','nexturl','q'));
-
 
563
	}
-
 
564
	
-
 
565
	public function nextsearch(){
-
 
566
		$this->layout = 'ajax';
-
 
567
		$page = $this->request->query('page');
-
 
568
		$ser = $this->request->query('search_text');
-
 
569
		if(!isset($page)){
-
 
570
			$page = 1;
-
 
571
		}
-
 
572
		$offset = ($page - 1)*20;
-
 
573
// 		$noti='[{"title": "Riviera Series J Battery For Micromax A240","id": "28750"}]';
-
 
574
// 		$result = json_decode($noti,1);
-
 
575
		
-
 
576
		$url = "http://shop2020.in:8080/dtr/solr-search!getSearchResults?search_text=".urlencode($ser)."&offset=".$offset;
-
 
577
		$result = $this->make_request($url, null);
-
 
578
		
-
 
579
		$nexturl = "/store_products/nextsearch?page=".($page+1)."&search_text=".urlencode($ser);
-
 
580
		$this->set(compact('result','nexturl'));
-
 
581
		$this->render('/Elements/newsearchresult');
-
 
582
	}
537
}
583
}