Subversion Repositories SmartDukaan

Rev

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

Rev 13689 Rev 13719
Line 105... Line 105...
105
		$page = $this->request->query('page');
105
		$page = $this->request->query('page');
106
		if(!isset($page)){
106
		if(!isset($page)){
107
			$page = 1;
107
			$page = 1;
108
		}	
108
		}	
109
		$this->loadModel('Api');
109
		$this->loadModel('Api');
110
		$apideals = $this->Api->getDealsByCategory($this->Auth->User('id'),$id,1);
110
		$apideals = $this->Api->getDealsByCategory($this->Auth->User('id'),$id,$page);
111
		$deals = $apideals['products'];
111
		$deals = $apideals['products'];
112
		$myactions = $this->Api->getMyActions($this->Auth->User('id'));
112
		$myactions = $this->Api->getMyActions($this->Auth->User('id'));
113
		if(!empty($myactions)) {
113
		if(!empty($myactions)) {
114
			foreach ($myactions['actions'] as $key => $value) {
114
			foreach ($myactions['actions'] as $key => $value) {
115
				if($value['UserAction']['action'] == 'like'){
115
				if($value['UserAction']['action'] == 'like'){
Line 144... Line 144...
144
					$disLikedDeals[$value['UserAction']['store_product_id']] = $value['UserAction']['id'];
144
					$disLikedDeals[$value['UserAction']['store_product_id']] = $value['UserAction']['id'];
145
				}
145
				}
146
			}
146
			}
147
		}
147
		}
148
		$this->set(compact('deals','id','page','likedDeals','disLikedDeals'));
148
		$this->set(compact('deals','id','page','likedDeals','disLikedDeals'));
149
		$this->render('/Elements/categorydeals');
149
		$this->render('/Elements/deals');
150
	}
150
	}
151
/**
151
/**
152
 * add method
152
 * add method
153
 *
153
 *
154
 * @return void
154
 * @return void