Subversion Repositories SmartDukaan

Rev

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

Rev 17025 Rev 18164
Line 87... Line 87...
87
				// $url = str_replace('www','m',$url);
87
				// $url = str_replace('www','m',$url);
88
				$url = str_replace('www.','',$url);
88
				$url = str_replace('www.','',$url);
89
                $url = str_replace('http://','',$url);
89
                $url = str_replace('http://','',$url);
90
                $url = str_replace('flipkart.com','http://dl.flipkart.com/dl',$url);
90
                $url = str_replace('flipkart.com','http://dl.flipkart.com/dl',$url);
91
			} elseif($storeId == 3) {
91
			} elseif($storeId == 3) {
-
 
92
				$tag='SHASNAPDEAL123';
92
				$url_parts = parse_url($url);
93
				$url_parts = parse_url($url);
93
				$url_parts['path'] = str_replace('viewAllSellers/','',$url_parts['path']);//quickfix for snapdeal
94
				$url_parts['path'] = str_replace('viewAllSellers/','',$url_parts['path']);//quickfix for snapdeal
94
				if(isset($url_parts['query'])) {
95
			if(isset($url_parts['query'])) {
95
					$url = "http://m.snapdeal.com".$url_parts['path'].'?'.$url_parts['query']."&utm_source=aff_prog&utm_campaign=afts&offer_id=17";
96
					//$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'].'?';//.'?'.'utm_source=aff_prog&utm_campaign=afts&offer_id=17';
96
				}else{
98
				}else{
97
					$url = "http://m.snapdeal.com".$url_parts['path'].'?utm_source=aff_prog&utm_campaign=afts&offer_id=17';
99
					$url = "http://m.snapdeal.com".$url_parts['path'].'?';
98
				}
100
				}	
99
			} elseif($storeId == 4){
101
			} elseif($storeId == 4){
100
				$urlparts = parse_url($url);
102
				$urlparts = parse_url($url);
101
				$url = $urlparts['path'];
103
				$url = $urlparts['path'];
102
				if(!empty($urlparts['query'])){
104
				if(!empty($urlparts['query'])){
103
					$url .= '?'.$urlparts['query'];	
105
					$url .= '?'.$urlparts['query'];	
Line 123... Line 125...
123
			if( strpos($url, '?') === false ) {
125
			if( strpos($url, '?') === false ) {
124
				$firstChar = '?';
126
				$firstChar = '?';
125
			} else {
127
			} else {
126
				$firstChar = '&';
128
				$firstChar = '&';
127
			}
129
			}
-
 
130
			if ($storeId!=3) {
128
			$url .= $firstChar.$store['Store']['affid_param'].'='.$store['Store']['affiliate_id'];
131
				$url .= $firstChar.$store['Store']['affid_param'].'='.$store['Store']['affiliate_id'];
129
			if(!empty($store['Store']['sub_tag_param'])){
132
				if(!empty($store['Store']['sub_tag_param'])){
130
				$url .= '&'.$store['Store']['sub_tag_param'].'='.$tag;
133
					$url .= '&'.$store['Store']['sub_tag_param'].'='.$tag;
-
 
134
				}
131
			}
135
			}
132
			$extras = array('store'=>$store['Store']['name']);
136
			$extras = array('store'=>$store['Store']['name']);
133
			$data = array('user_id'=>$userId,'store_product_id'=>$storeProductId,'price'=>$available_price,'tag'=>$tag,'url'=>$url,'extras'=>json_encode($extras));
137
			$data = array('user_id'=>$userId,'store_product_id'=>$storeProductId,'price'=>$available_price,'tag'=>$tag,'url'=>$url,'extras'=>json_encode($extras));
134
			$this->Click->create();
138
			$this->Click->create();
135
			$curl = $this->livepriceurl."!latestPriceById?id=$storeProductId&source_id=$storeId&url=".base64_encode($url);
139
			$curl = $this->livepriceurl."!latestPriceById?id=$storeProductId&source_id=$storeId&url=".base64_encode($url);
Line 334... Line 338...
334
		} else {
338
		} else {
335
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
339
			$this->Session->setFlash(__('The click could not be deleted. Please, try again.'));
336
		}
340
		}
337
		return $this->redirect(array('action' => 'index'));
341
		return $this->redirect(array('action' => 'index'));
338
	}
342
	}
339
}
343
}
340
344