Subversion Repositories SmartDukaan

Rev

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

Rev 11813 Rev 11845
Line 53... Line 53...
53
		$data['stylesheet'] = 'pd-list.css';
53
		$data['stylesheet'] = 'pd-list.css';
54
		//TODO: Get coupon code from api
54
		//TODO: Get coupon code from api
55
		$data['response']['couponcode'] = "saholicdeal";
55
		$data['response']['couponcode'] = "saholicdeal";
56
		$this->layout->view('privatedeals/products_view',$data);
56
		$this->layout->view('privatedeals/products_view',$data);
57
	}
57
	}
-
 
58
 
-
 
59
	public function getProductList($page=null)
-
 
60
	{
-
 
61
		$page = 1;
-
 
62
		$userId = $this->session->userdata['authorized']['Id'];
-
 
63
	 	$value = intval($category);
-
 
64
     	$url = $this->config->item('private_deals');
-
 
65
	  	$url = $url['url'];
-
 
66
        $url = $this->config->item('curl_base_url').$url.'/'.$page;	         	
-
 
67
        $configdata =array();
-
 
68
        $configdata = $this->config->item('privatedeals');
-
 
69
        $response = $this->privatedeal_model->getProducts('',$this->input->post(),$configdata, $userId,$page);
-
 
70
		$response = $response['response']['private_deals'];	
-
 
71
		$count = $response[0]->response->count;
-
 
72
		$productListResponse ='';
-
 
73
		$TotalPage = ceil($count/10);
-
 
74
		if($TotalPage < $page) {$product_list='';}
-
 
75
		else{$product_list = $response;}
-
 
76
		 
-
 
77
		if(isset($product_list) and !empty($product_list))
-
 
78
		{
-
 
79
			foreach($product_list[0]->response->items as $pl)
-
 
80
			{
-
 
81
				if(isset($pl->image_url) and !empty($pl->image_url))
-
 
82
				{
-
 
83
						$productListResponse .= '<a class="pd-list" href="'. base_url().$pl->url.'">
-
 
84
          				<div class="pd-image" style="background:url(\''.$pl->image_url.'\')no-repeat center center;background-size:contain;"></div>
-
 
85
          					<div class="pd-info">
-
 
86
            				<div class="pdt-name">'.$pl->title.'</div>
-
 
87
           			 		<div class="pdt-price">';
-
 
88
           			 		if(isset($pl->price) || isset($pl->mrp)){
-
 
89
           			 			$productListResponse .='<span class="pr">Rs</span>';
-
 
90
           			 			if(isset($pl->mrp) && $pl->mrp != 0){
-
 
91
           			 				$productListResponse .='<span class="pr-linethrough">'.$pl->mrp.'</span>';
-
 
92
           			 			}
-
 
93
           			 			if(isset($pl->price) && $pl->price != 0){
-
 
94
           			 				$productListResponse .='<span class="pr-linethrough">'.$pl->price.'</span>';
-
 
95
           			 			}	
-
 
96
           			 			if(isset($pl->dealprice) && $pl->dealprice != 0){
-
 
97
           			 				$productListResponse .='<span class="pr-original">'.$pl->dealprice.'</span>';
-
 
98
           			 			}			
-
 
99
           			 		}
-
 
100
           			 		$productListResponse .='</div><div class="pdt-spec">'. $pl->description.' </div>';
-
 
101
 
-
 
102
           			 		$productListResponse .= '<div class="pdt-offercolors">Offer available for : '.implode(',',$pl->dealcolors).'</div>';
-
 
103
           			 		if(isset($pl->offer_text) && !empty($pl->offer_text)) {
-
 
104
	           			 		$productListResponse .= '<div class="pdt-offertext">Offer includes : '.$pl->offer_text.'</div>';	
-
 
105
	           			 	}
-
 
106
 
-
 
107
           			 		$productListResponse .= '</div></a>';
-
 
108
					
-
 
109
				}		
-
 
110
 
-
 
111
			}
-
 
112
		}
-
 
113
		echo $productListResponse;
-
 
114
 
-
 
115
	}
58
}
116
}
59
117