| Line 54... |
Line 54... |
| 54 |
*/
|
54 |
*/
|
| 55 |
public function add($userId=null,$storeProductId=null,$storeId=null) {
|
55 |
public function add($userId=null,$storeProductId=null,$storeId=null) {
|
| 56 |
session_write_close();
|
56 |
session_write_close();
|
| 57 |
if(!empty($userId) && !empty($storeProductId)){
|
57 |
if(!empty($userId) && !empty($storeProductId)){
|
| 58 |
$url = $this->request->query('url');
|
58 |
$url = $this->request->query('url');
|
| 59 |
$url1=$url;
|
- |
|
| 60 |
$available_price = $this->request->query('price');
|
59 |
$available_price = $this->request->query('price');
|
| 61 |
//Get StoreProduct Info
|
60 |
//Get StoreProduct Info
|
| 62 |
$this->loadModel('Store');
|
61 |
$this->loadModel('Store');
|
| 63 |
// $options = array('conditions'=>array('id'=>$storeProductId),'fields'=>array('source_id','available_price','url'),'recursive'=>-1);
|
62 |
// $options = array('conditions'=>array('id'=>$storeProductId),'fields'=>array('source_id','available_price','url'),'recursive'=>-1);
|
| 64 |
// $storeProduct = $this->StoreProduct->find('first',$options);
|
63 |
// $storeProduct = $this->StoreProduct->find('first',$options);
|
| Line 74... |
Line 73... |
| 74 |
$storeProduct = json_decode($product[0],1);
|
73 |
$storeProduct = json_decode($product[0],1);
|
| 75 |
$url = $storeProduct['marketPlaceUrl'];
|
74 |
$url = $storeProduct['marketPlaceUrl'];
|
| 76 |
$storeId = $storeProduct['source_id'];
|
75 |
$storeId = $storeProduct['source_id'];
|
| 77 |
$available_price = $storeProduct['available_price'];
|
76 |
$available_price = $storeProduct['available_price'];
|
| 78 |
}
|
77 |
}
|
| - |
|
78 |
$url1=$url;
|
| 79 |
$cachekey = 'store-'.$storeId;
|
79 |
$cachekey = 'store-'.$storeId;
|
| 80 |
//$store = Cache::read($cachekey,'month');
|
80 |
//$store = Cache::read($cachekey,'month');
|
| 81 |
if(empty($store)) {
|
81 |
if(empty($store)) {
|
| 82 |
$store = $this->Store->find('first',array('recursive'=>-1,'conditions'=>array('id'=>$storeId)));
|
82 |
$store = $this->Store->find('first',array('recursive'=>-1,'conditions'=>array('id'=>$storeId)));
|
| 83 |
Cache::write($cachekey,$store,'month');
|
83 |
Cache::write($cachekey,$store,'month');
|