<?php 
if(isset($cmbn_det["Productdetail"]["pdctfile"]))
{
	$imgname=explode(".",$cmbn_det["Productdetail"]["pdctfile"]);
	$ext=end(explode(".",$cmbn_det["Productdetail"]["pdctfile"]));
        if($imgname[0]!='')
            $img=$imgname[0]."_thumb.".$ext;
        else
            $img='noimages_thumb.gif';
	echo $html->image('/img/products/'.$img,array('border' => '0','width' => '129' ,'height' => '104'));		
}
?>|~^@^~|
<!--<div style="width:100px; float:left; padding:18px 0 18px 5px; ">

<?php //if(isset($cmbn_det["Productdetail"]["skuno"]) && $cmbn_det["Productdetail"]["skuno"] <> '') { ?><b>SKU No  : </b><?php //echo $cmbn_det["Productdetail"]["skuno"]; ?><?php //} ?>
</div>-->
<div>

<a class="buy-now right" href="<?php echo $html->url('/carts/add/'.$cmbn_det["Productdetail"]["product_id"]."/".$cmbn_det["Productdetail"]["category_id"]."/".$cmbn_det["Productdetail"]["id"])?>">
Add to Cart
</a>	
</div>|~^@^~|<?php echo $cmbn_det["Productdetail"]["skuno"]; ?>|~^@^~|
 <?php
 //Setting the Prices & Discount for Wholesale/Retail Users
	$prod_price=0;
	$discnt_type='';
	if(isset($prod_det["Product"]["discount_type"]) && $prod_det["Product"]["discount_type"] <> '')
	$discnt_type=$prod_det["Product"]["discount_type"];
	$discnt_price=$prod_discnt;			
	$wholesale_price=0;
	$retail_price=0;
	
	if(isset($sus) && empty($sus)===false)
	{
		 if($sus["usertype"]=='wholesale')
		 {										 		
			if(isset($prod_det["Product"]["wholesale_price"]) && $prod_det["Product"]["wholesale_price"] > 0 )
			{
				$wholesale_price=($prod_det["Product"]["wholesale_price"] + $cmbn_det["Productdetail"]["extraprice"]);			
				$utype='wholesale';
				display_combnprice($utype,$wholesale_price,$discnt_type,$discnt_price,$curlogo);
				echo "<br>";
			}	
			if(isset($prod_det["Product"]["price"]))
			{
				$retail_price=($prod_det["Product"]["price"] + $cmbn_det["Productdetail"]["extraprice"]);			
				$utype='retail';
				display_combnprice($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
			}	
		 }	
		 else if($sus["usertype"]=='retail')
		 {										 		
			if(isset($prod_det["Product"]["price"]))
			$retail_price=($prod_det["Product"]["price"] + $cmbn_det["Productdetail"]["extraprice"]);
			$utype='retail';
			display_combnprice($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
		 }												 									 
	}	
	else
	 {  		
		if(isset($prod_det["Product"]["price"]))
		$retail_price=($prod_det["Product"]["price"] + $cmbn_det["Productdetail"]["extraprice"]);		
		$utype='normal';		
		display_combnprice($utype,$retail_price,$discnt_type,$discnt_price,$curlogo);
	 }												  
	//Setting the Prices for Wholesale/Retail Users
?>
|~^@^~|<p>Stock : <?php echo $cmbn_det["Productdetail"]["stock"] ?> (Items)</p>	
<?php
function display_combnprice($utype='',$prod_price='',$discnt_type='',$discnt_price='',$curlogo='')
{
    if($utype=='wholesale')
    echo "<p>Wholesale Price : ";
    else if($utype=='retail'){
        if($_SESSION['User']['Usertype']=='wholesale')
            echo "<p>Retail Price : ";
        else
            echo "<p>Price : ";    }
    else if($utype=='normal')
    echo "<p>Price : ";
					   
  $combined_price=$prod_price;
  

  if(isset($discnt_type) && trim($discnt_type) <> '')
  { 
	if($discnt_type=='per')
	 {
	  if(isset($discnt_price) && $discnt_price <> '' && $discnt_price > 0)
		{
		 $discounted_price=($combined_price-(($combined_price * $discnt_price)/100));
		 $final_price=$discounted_price;
		 echo "<span><strike>".$curlogo.number_format(($combined_price),2,'.','')."</strike>&nbsp;&nbsp;".$curlogo.number_format($final_price,2,'.','')."</span>";							 
		}			
		else
		echo "<span>".$curlogo.number_format(($combined_price),2,'.','')."</span>";					 
	 }
	 else if($discnt_type=='amnt')
	 {	 
		 if(isset($discnt_price) && $discnt_price <> '' && $discnt_price > 0)
		 {
			$final_price=(($combined_price)-$discnt_price);						
			echo "<span><strike>".$curlogo.number_format(($combined_price),2,'.','')."</strike>&nbsp;&nbsp;".$curlogo.number_format($final_price,2,'.','')."</span>";								 
		 }			
		 else
		 echo "<span>".$curlogo.number_format(($combined_price),2,'.','')."</span>";				
	}
  }
 else
 {
  $final_price= $combined_price;
  echo "<span>".$curlogo.number_format($final_price,2,'.','')."</span>";			
 }	
 echo '</p>';
} 	 			 								
?>	