Subversion Repositories SmartDukaan

Rev

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

Rev 11752 Rev 12056
Line 65... Line 65...
65
				if(isset($item->mrp) && $item->mrp != 0){
65
				if(isset($item->mrp) && $item->mrp != 0){
66
					$mrp = $item->mrp;
66
					$mrp = $item->mrp;
67
					$discount = (($mrp - $sellingPrice)/$mrp);
67
					$discount = (($mrp - $sellingPrice)/$mrp);
68
	    			$discount = round($discount*100);
68
	    			$discount = round($discount*100);
69
	    			$data['response']['response']['product_details'][0]->entity->items[$i]->discount = $discount;
69
	    			$data['response']['response']['product_details'][0]->entity->items[$i]->discount = $discount;
70
	    			$i++;
-
 
71
				}
70
				}
-
 
71
				if(isset($item->dealPojo)) {
-
 
72
					$mrp = $item->mrp;
-
 
73
					$discount = (($mrp - $item->dealPojo->dealPrice)/$mrp);
-
 
74
					$discount = round($discount*100);
-
 
75
					$data['response']['response']['product_details'][0]->entity->items[$i]->discount = $discount;
-
 
76
					$data['response']['response']['product_details'][0]->entity->items[$i]->dealPrice = $item->dealPojo->dealPrice;
-
 
77
					$data['response']['response']['product_details'][0]->entity->items[$i]->dealText = $item->dealPojo->dealText;
-
 
78
				}
-
 
79
	    			$i++;
72
			}
80
			}
73
			if(!isset($id) || empty($id)){
81
			if(!isset($id) || empty($id)){
74
				redirect(base_url());
82
				redirect(base_url());
75
			}
83
			}
76
			$name = str_replace(' ', '-', $data['response']['response']['product_details'][0]->entity->name);
84
			$name = str_replace(' ', '-', $data['response']['response']['product_details'][0]->entity->name);
Line 99... Line 107...
99
				}
107
				}
100
				$metaDescription = $data['response']['response']['product_details'][0]->entity->metaDescription;
108
				$metaDescription = $data['response']['response']['product_details'][0]->entity->metaDescription;
101
				if(isset($metaDescription) && !empty($metaDescription)){
109
				if(isset($metaDescription) && !empty($metaDescription)){
102
					$data['metaDescription'] = $metaDescription;
110
					$data['metaDescription'] = $metaDescription;
103
				}
111
				}
104
				$subView = $this->session->userdata('subView');
112
				/*$subView = $this->session->userdata('subView');
105
				if(isset($subView) && !empty($subView))
113
				if(isset($subView) && !empty($subView))
106
				{
114
				{
107
				    $data['subView'] = $subView;
115
				    $data['subView'] = $subView;
108
				}
116
				}
109
				elseif(mt_rand(1,2) % 2)
117
				elseif(mt_rand(1,2) % 2)
Line 113... Line 121...
113
				}
121
				}
114
				else
122
				else
115
				{
123
				{
116
				    $data['subView'] = 'b';
124
				    $data['subView'] = 'b';
117
				    $this->session->set_userdata('subView','b');
125
				    $this->session->set_userdata('subView','b');
118
				}
126
				}*/
-
 
127
				$data['subView'] = 'b';
119
				//end of set cache
128
				//end of set cache
120
				$this->layout->view('productinfo/productinfo_view',$data);
129
				$this->layout->view('productinfo/productinfo_view',$data);
121
			}
130
			}
122
			else{
131
			else{
123
				$url = base_url().strtolower(get_class()).'/'.$apiCode;
132
				$url = base_url().strtolower(get_class()).'/'.$apiCode;
Line 145... Line 154...
145
    	return preg_replace('/[^a-zA-Z0-9]/', '', $string);
154
    	return preg_replace('/[^a-zA-Z0-9]/', '', $string);
146
	}
155
	}
147
}
156
}
148
 
157
 
149
/* End of file welcome.php */
158
/* End of file welcome.php */
150
/* Location: ./application/controllers/welcome.php */
-
 
151
159
/* Location: ./application/controllers/welcome.php */
-
 
160