<link rel="stylesheet" type="text/css" href="catalog/template/beststoreitems/css/page.css">
<table  align="left" style=" width:100%;"><tr height="10"><td></td></tr><tr><td align="left">
<script type="text/javascript">
 function sort_by()
	 {
		var sort_by=$("#sort_by").val();
		location='https://www.beststoreitems.com/index.php?controller=list&path=<?php echo $path?>&sort_by='+sort_by;
	 }
	function add_to_cart(id)
	{
		document.location.href= id;
	}
</script>
<style type="text/css">
/*.B_Categories {border:1px solid #ddd; margin-bottom:20px;}
.goods_list{padding:15px 3px;margin:10px;overflow:hidden;position:relative;border-bottom:1px solid #ddd;}
.goods_list .hot-iocn{position:absolute; top:0; left:0; width:37px; height:35px;}
.goods_picture div{position:absolute;bottom:0; right:0;}
.goods_list .goods_picture{height:270px;overflow:hidden;text-align:left;position:relative;margin-bottom:7px; width:270px; float:left;}
.list_stars{margin:10px 0;} 
.list_stars .star{margin-top:1px;}
.tags_pic .goods_list .goods_name{display:block;font-size:11px;font-weight:normal;height:28px;overflow:hidden;line-height:14px;padding:0 0 2px; margin-bottom:34px;}
.goods_list .tags_price{float:right; width:80px;}
.goods_list .tags_pro{float:left;width:140px; color:#414141; height:54px;overflow:hidden; font-size:10px;}
.goods_list .goods_info{float:left; width:55%; margin:0 0 0 10px; padding-top:20px;}
.goods_list .goods_title{display:block;overflow:hidden;line-height:150%;padding:0 0 2px;}
.goods_list .goods_title a{color:#085CA8;font:18px/120% "Times New Roman"}
.goods_list .goods_title a:hover{color:#ff5a00; text-decoration:underline;}
.goods_list .Reference_Price{padding:0 0 2px; margin-top:10px;text-align:left;}
.goods_list .Reference_Price span{color: #f60;font-family: arial;font-size: 18px;font-weight: bold;}
.goods_list .Reference_Price del{font-style:oblique;font-weight:normal; color:#999; font-weight:bold;}
.goods_list .list_stars_rew{margin:4px 0;}
.goods_list .list_stars_rew a{font-size:10px;}
.goods_list .list_stars_rew img{float:left; margin:1px 5px 0 -1px;}
.goods_list .goods_name{margin-top:10px; padding:0 0 2px;}
.goods_list .other_info{float:right; width:200px; text-align:right; margin-right:10px; padding-top:18px;}
.goods_list .other_info a{ font-size:12px; color:#114EA6; text-decoration:underline;}*/
.view_all,.freeShip,.wishlist{background: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/view_det.gif") no-repeat scroll 0 0 transparent;}
.view_all { background-position:0 0;padding:0 0 0 25px; height:19px; line-height:19px; display:inline-block; margin-top:5px;}
.freeShip{ background-position:0 -18px;color:#6BAB01; margin-top:6px; text-align:left; padding-left:16px;}
.wishlist{ background-position:95px -31px;margin:22px 0 25px;height:19px; line-height:19px; }

.tags_pic .goods_list .list_stars{margin-top:0;}
.tags_pic .goods_list{height:440px;width:226px;margin:10px 8px 30px 14px;}
.tags_pic .goods_picture{height:310px;}
.goods_list .save_per{padding:0 0 2px;filter:;}
.goods_list .list_stars .starsSmall_box{float:right;filter:;}
/*.goods_list .list_stars span{float:right;width:auto;display:block;}*/
.hover_cancel{height:9px;width:9px;background:url('./Cancel_but.gif') no-repeat 0 4px;}
.hover_cancel:hover{background:url('./Cancel_but2.gif') no-repeat 0 4px;text-decoration:none;}
.details_l{border:1px solid #FFB548; background:#F9F4E2; padding:10px 5px; }

.reviews{height:30px;line-height:27px;}
.reviews a{color:gray;font-weight: normal;text-decoration: underline;}
.reviews a:hover {color: #FF5A00;text-decoration: none;}
.products img{float:left; margin:15px;}
.products .reviews img{float:left; margin:9px;}
.products_right{text-align:left;width:530px; float:right;clear:right; margin-top:22px;}
#no_border{border:none; background:none;}
.current_i{ background:#666; color:#fff; border:1px solid #666666; height:14px; padding:3px 6px;} 
.s_result{border:1px solid #E9E9E9; border-bottom:none; background:#fff; height:30px;padding:0 10px;}
.s_result dt{float:left; line-height:28px; }
.s_result dd{float:right;}
.s_result dt b {color:#F38514;font-weight: 700;}
.d_result{background: #E9E9E9;border-top: 1px solid #D0D0D0;height: 29px;padding: 0 10px;}
.d_result dt {float: left;padding-top: 6px;}
.d_result dd{float:right; padding-top:6px;_padding-top:3px;}
.d_result dd .now {background: none repeat scroll 0 0 #4A4A4A;border: 1px solid #2D2D2D;color: #FFFFFF;display: inline-block;line-height: 12px;margin-right: 4px;padding: 2px;
vertical-align: middle; font-size:10px;}
.d_result dd a {background: none repeat scroll 0 0 #FFFFFF;border: 1px solid #999999;color: #999999;display: inline-block;font-weight: 700;line-height: 12px;margin-right: 4px;    padding: 2px;vertical-align: middle; font-size:10px;}
.d_result dd a:hover{color:#4a4a4a; border:1px solid #4a4a4a;}
.d_result dd select{color:#999; font-family:verdana;}
.list, .grid, .gallery, .list_on, .grid_on, .gallery_on {background: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/thing.png") no-repeat scroll 0 0 transparent;display: inline-block;height: 16px;margin-right:7px;overflow: hidden;width: 16px;}
.list_on,.list:hover{background-position:0 -16px;}
.gallery_on,.gallery:hover{ background-position:-32px -16px;}
.gallery{ background-position:-32px 0;}
.grid{background-position:-16px 0;}
.grid_on,.grid:hover{ background-position:-16px -16px;}
.star {display: block;height: 16px; margin: 0 5px 0 0;_margin: 0 2px 0 0;width:59px;float:left;}
.star-x {background: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/star_big_gray_16.gif") repeat-x scroll left top transparent;}
.star-x span { background: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/star_big_color_16.gif") repeat-x scroll left top transparent;}
.star span {display: block;height: 100%;width: 0;}
.heading{margin-bottom:0;}
table.page{border-collapse:separate; border-spacing:5px;}
table.page tr,table.page td{font-size:11px;}
.outOfStock{left:-170px; top:-55px; position:relative;}
</style>

	<!--start-->
    <div class="breadcrumb">
        <ul class="w-breadcrumb clearfix">
            <?php foreach ($breadcrumbs as $breadcrumb) { ?>
            <li class="sub">
            <a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?><i>&raquo;</i></a>
            </li>
            <?php } ?>
        </ul>
    </div>
    <!--end-->
<?php if ($categories) { ?>
<?php foreach ($categories as $category) { ?>
<div class="categories" style="height:180px;"><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" title="<?php echo $category['name']; ?>" alt="<?php echo $category['name']; ?>" /></a><br />

  <a href="<?php echo $category['href']; ?>"><strong><?php echo $category['name']; ?></strong></a></div>

<?php } ?>

<?php } ?>

<?php if ($products) { ?>

<?php if ($categories) { ?>

<div class="heading"><?php echo $text_product; ?></div>

<?php } ?>
</td></tr>

<tr>
	<td align="left">
        <dl class="s_result">
             <dt><b><?php echo $text_results; ?></b> items in <strong><?php echo $heading_title; ?></strong> category</dt>
            <dd></dd>
        </dl>
        <dl class="d_result">
        
            <dt>
                <label><a class="list_on"></a></label>
                <label><a class="gallery" href="index.php?controller=category&path=<?php echo $path?>"></a></label>

            </dt>
        	<?php if (!$categories) { ?>
            
            <dd>
            	items per page:
                <?php if($amount==24){?><b class="now">24</b><?php }else {?>
                <a href="index.php?controller=<?php echo $view_controller?>&path=<?php echo $path?>&amount=24<?php if($view_controller=='sort')echo '&sort_by='.$sort_by?>">24</a>
                <?php }?>
                <?php if($amount==36){?><b class="now">36</b><?php }else {?>
                <a href="index.php?controller=<?php echo $view_controller?>&path=<?php echo $path?>&amount=36<?php if($view_controller=='sort')echo '&sort_by='.$sort_by?>">36</a>
                <?php }?>
                <?php if($amount==48){?><b class="now">48</b><?php }else {?>
                <a href="index.php?controller=<?php echo $view_controller?>&path=<?php echo $path?>&amount=48<?php if($view_controller=='sort')echo '&sort_by='.$sort_by?>">48</a>
                <?php }?>

                Sort by:
                <select name="sort_by" id="sort_by" onchange="sort_by()">
                    <option value="4"<?php if($sort_by==4) echo 'selected'?>>Newest</option>
                    <option value="1"<?php if($sort_by==1) echo 'selected'?>>Bestselling</option>
                    <option value="2"<?php if($sort_by==2) echo 'selected'?>>Price:lowest first</option>
                    <option value="3"<?php if($sort_by==3) echo 'selected'?>>Price:highest first</option>
                </select>
            </dd>
	<?php }?>
        </dl>
    </td>
    </tr>

<tr><td  align="left">

<div style="width:100;float:left;clear:both;"></div>

<!-- product list start-->
<div class="col-main col-sm-24">
  <ul>
   <?php foreach ($products as $product) { ?>
   	<input type="hidden" name="product_id" value="<?php echo $product['product_id']; ?>" /> 
	<input type="hidden" name="quantity" value="1" /> 
    <li class="goods_list clearfix">
      <div class="goods_picture">              
         <a  href="<?php echo $product['href']; ?>" title=""><img width="270"  alt="<?php echo $product['name']; ?>" src="<?php echo $product['thumb']; ?>"></a>
      </div>
      
      <div class="goods_info">
      		<strong class="goods_title"> <a title="<?php echo $product['name']; ?>" href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> </strong> 	   
	        <p class="Reference_Price">General Price: <del><?php echo $product['market_price']; ?></del></p>
            <p class="Reference_Price">Our Price: 
                <span><?php echo $product['price']; ?></span>
                <label style="color:blue; margin-left:5px;">Sold:&nbsp;<?php if($product['sold']==1) {echo $product['sold'].' '.'pc';} else{echo $product['sold'].' '.'pcs';} ?></label>
            </p>
            <p class="goods_name">Item Number: <?php echo $product['product_id']?></p> 
	        <div class="list_stars">
		      <div class="star star-x"><span style="width:<?php echo intval($product['feedback']['avg']*20)?>%;"></span></div>
		      <a href="<?php echo $product['href']; ?>#cmt" rel="nofollow"> <?php echo $product['feedback']['total']?> <?php echo $product['feedback']['total']>1?'Reviews':'Review'?></a>
	        </div>  
            <p class="freeShip">Free Shipping</p> 

			 <?php if($product['quantity']==0){?>
	  	     <span class="outOfStock"><img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/soldout_pending.jpg"></span>
              <?php }?>
               <?php if($product['sold']>=15){?>
                  <p class="hot-iocn"><img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/hot.png"></p>
               <?php } elseif($product['shelf_on_time']>=date('Y-m-d H:i:s',(time()-86400*30))){?>
                  <p class="hot-iocn"><img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/new.png"></p>
               <?php }elseif($product['sold']>=15&&$product['shelf_on_time']>=date('Y-m-d H:i:s',(time()-86400*30))){?>
                  <p class="hot-iocn"><img src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/hot.png"></p>
             <?php }?>
      </div>
      
      <div class="other_info">
      		  <p><a href="<?php echo $product['href']; ?>" class="view_all">View Detail</a></p>
              <p class="wishlist"><a  href="/index.php?controller=wish&action=addwish&pro_id=<?php echo $product['product_id'];?>" title="Add to Wish List">Add to Wish List</a></p>
      		  <div class="addcart"><?php if($product['quantity']>0){?>
				<input  type="image" onclick="return add_to_cart('<?php echo $product['href']; ?>');" src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/addtocart.gif" value=""/>
			  <?php  } else{?>
			         <a title="Add to Wish List"><img border="0" src="https://www.beststoreitems.com/catalog/template/beststoreitems/image/addtocart_gray.gif" /></a>
			  <?php }?></div>
			  
      </div>    
    </li>
    <?php }?>
    
 </ul>
  <div class="hei20"></div>
  <table width="100%">

            <tr>
            <td align="left">
            	<dl class="s_result" id="no_border">
             		<dt><b><?php echo $text_results; ?></b> items in <strong><?php echo $heading_title; ?></strong> category</dt>
                </dl>
            </td>

            <td align="right">

          <table cellspacing="5" cellpadding="0" class="page">

            <tr>

            <?php if ($page>1) { ?>

            <td id="page_box_previous"><a href="#" onclick="return SelectPage(<?php echo ($page-1); ?>);"><?php echo 'Previous'?></a></td>
            <?php };

            foreach ($pages as $pageentry) {   

                    if ( $pageentry['value'] > ($page + max(9-$page,4)) ) {?>

                               <td id="page_box_next"><a href="#" onclick="return SelectPage(<?php echo ($page+1); ?>);"><?php echo 'Next'?></a></td>

                    <?php 

                         break;

                     } ;

                    

                    if ( $pageentry['value'] < ($page - 4) ) {continue; }

                    ?>

                                              

                    <?php if ($pageentry['value'] == $page) { ?>

                    <td width="20" height="16" align="center" valign="middle"><b class="current_i"><font size="1"><?php $x = explode(" ",$pageentry['text']);echo $x[0]; ?></font></b></td>

                    <?php } else { ?>

                    <td id="page_box" >

                    <a href="#" onclick="return SelectPage(<?php echo $pageentry['value'];?>)"><?php $x = explode(" ",$pageentry['text']);echo $x[0]; ?></a></td>

                    <?php } ?>   

            <?php } ?>
			<td>Go to Page
	        	<select onchange="return SelectPage(this.value)" style="width:50px;">
	        		<?php foreach ($pages as $pageentry){?>
	        			<option value="<?php echo $pageentry['value']?>" <?php if ($pageentry['value'] == $page){echo 'selected';}?>><?php echo $pageentry['value']?></option>
	        		<?php };?>
	        	</select>
	        </td>
          </tr></table>

    </td></tr></table>
    <div class="hei10"></div>
</div>
<!-- product list start -->



</td></tr>
<?php } ?>
</table>
<a href="#" rel="bb"></a>
