Subversion Repositories SmartDukaan

Rev

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

Rev 12056 Rev 12062
Line 20... Line 20...
20
		
20
		
21
 
21
 
22
	}
22
	}
23
	public function index()
23
	public function index()
24
	{
24
	{
-
 
25
		$authorized=$this->session->userdata('authorized');
25
		//standard array
26
		//standard array
26
		$data = array();
27
		$data = array();
27
		//get cache 
28
		//get cache 
28
		$configdata =array();
29
		$configdata =array();
29
		$configdata = $this->config->item('productinfo');
30
		$configdata = $this->config->item('productinfo');
Line 66... Line 67...
66
					$mrp = $item->mrp;
67
					$mrp = $item->mrp;
67
					$discount = (($mrp - $sellingPrice)/$mrp);
68
					$discount = (($mrp - $sellingPrice)/$mrp);
68
	    			$discount = round($discount*100);
69
	    			$discount = round($discount*100);
69
	    			$data['response']['response']['product_details'][0]->entity->items[$i]->discount = $discount;
70
	    			$data['response']['response']['product_details'][0]->entity->items[$i]->discount = $discount;
70
				}
71
				}
71
				if(isset($item->dealPojo)) {
72
				if(isset($item->dealPojo) && !empty($authorized['isPrivateDealUser'])) {
72
					$mrp = $item->mrp;
73
					$mrp = $item->mrp;
73
					$discount = (($mrp - $item->dealPojo->dealPrice)/$mrp);
74
					$discount = (($mrp - $item->dealPojo->dealPrice)/$mrp);
74
					$discount = round($discount*100);
75
					$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]->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]->dealPrice = $item->dealPojo->dealPrice;