| Line 88... |
Line 88... |
| 88 |
// $url = str_replace('www','m',$url);
|
88 |
// $url = str_replace('www','m',$url);
|
| 89 |
$url = str_replace('www.','',$url);
|
89 |
$url = str_replace('www.','',$url);
|
| 90 |
$url = str_replace('http://','',$url);
|
90 |
$url = str_replace('http://','',$url);
|
| 91 |
$url = str_replace('flipkart.com','http://dl.flipkart.com/dl',$url);
|
91 |
$url = str_replace('flipkart.com','http://dl.flipkart.com/dl',$url);
|
| 92 |
} elseif($storeId == 3) {
|
92 |
} elseif($storeId == 3) {
|
| 93 |
$tag='SHASNAPDEAL123';
|
93 |
//$tag='SHASNAPDEAL123';
|
| 94 |
$url_parts = parse_url($url);
|
94 |
$url_parts = parse_url($url);
|
| 95 |
$url_parts['path'] = str_replace('viewAllSellers/','',$url_parts['path']);//quickfix for snapdeal
|
95 |
$url_parts['path'] = str_replace('viewAllSellers/','',$url_parts['path']);//quickfix for snapdeal
|
| 96 |
if(isset($url_parts['query'])) {
|
96 |
if(isset($url_parts['query'])) {
|
| 97 |
//$url = "http://m.snapdeal.com".$url_parts['path'].'?'.$url_parts['query']."&utm_source=aff_prog&utm_campaign=afts&offer_id=17";
|
97 |
//$url = "http://m.snapdeal.com".$url_parts['path'].'?'.$url_parts['query']."&utm_source=aff_prog&utm_campaign=afts&offer_id=17";
|
| 98 |
$url = "http://m.snapdeal.com".$url_parts['path'].'?';//.'?'.'utm_source=aff_prog&utm_campaign=afts&offer_id=17';
|
98 |
$url = "http://m.snapdeal.com".$url_parts['path'].'?'.'utm_source=aff_prog&utm_campaign=afts&offer_id=17';
|
| 99 |
}else{
|
99 |
}else{
|
| 100 |
$url = "http://m.snapdeal.com".$url_parts['path'].'?';
|
100 |
$url = "http://m.snapdeal.com".$url_parts['path'].'?';
|
| 101 |
}
|
101 |
}
|
| 102 |
} elseif($storeId == 4){
|
102 |
} elseif($storeId == 4){
|
| 103 |
$urlparts = parse_url($url);
|
103 |
$urlparts = parse_url($url);
|
| Line 132... |
Line 132... |
| 132 |
$url .= $firstChar.$store['Store']['affid_param'].'='.$store['Store']['affiliate_id'];
|
132 |
$url .= $firstChar.$store['Store']['affid_param'].'='.$store['Store']['affiliate_id'];
|
| 133 |
if(!empty($store['Store']['sub_tag_param'])){
|
133 |
if(!empty($store['Store']['sub_tag_param'])){
|
| 134 |
$url .= '&'.$store['Store']['sub_tag_param'].'='.$tag;
|
134 |
$url .= '&'.$store['Store']['sub_tag_param'].'='.$tag;
|
| 135 |
}
|
135 |
}
|
| 136 |
}
|
136 |
}
|
| - |
|
137 |
else{
|
| - |
|
138 |
$url .= $firstChar.$store['Store']['affid_param'].'='.$store['Store']['affiliate_id'];
|
| - |
|
139 |
if(!empty($store['Store']['sub_tag_param'])){
|
| - |
|
140 |
$url .= '&'.$store['Store']['sub_tag_param'].'='.$tag;
|
| - |
|
141 |
}
|
| - |
|
142 |
}
|
| 137 |
$extras = array('store'=>$store['Store']['name']);
|
143 |
$extras = array('store'=>$store['Store']['name']);
|
| 138 |
$data = array('user_id'=>$userId,'store_product_id'=>$storeProductId,'price'=>$available_price,'tag'=>$tag,'url'=>$url,'extras'=>json_encode($extras));
|
144 |
$data = array('user_id'=>$userId,'store_product_id'=>$storeProductId,'price'=>$available_price,'tag'=>$tag,'url'=>$url,'extras'=>json_encode($extras));
|
| 139 |
$this->Click->create();
|
145 |
$this->Click->create();
|
| 140 |
$curl = $this->livepriceurl."!latestPriceById?id=$storeProductId&source_id=$storeId&url=".base64_encode($url1);
|
146 |
$curl = $this->livepriceurl."!latestPriceById?id=$storeProductId&source_id=$storeId&url=".base64_encode($url1);
|
| 141 |
$response = $this->make_request($curl,null);
|
147 |
$response = $this->make_request($curl,null);
|