<div class="breadcrumb-area mb-15">

		<div class="container">

			<div class="row">

				<div class="col">

					<div class="breadcrumb-container">

						<ul>

							<li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i> Search</a></li>

							<li class="active"><?php echo $_GET['search'];?></li>

						</ul>

					</div>

				</div>

			</div>

		</div>

	</div>

	

<div class="shop-page-container mb-50">

		<div class="container">

			<div class="row">

				
				<div class="col-lg-12 order-1 order-lg-2 mb-sm-15 mb-xs-15">			
					

					<div class="shop-product-wrap grid row no-gutters mb-35" id="ajaxpagination">

						<?php if(!empty($products)){foreach($products as $featp){?>

							<div class="col-xl-2 col-lg-2 col-md-2 col-sm-2 col-6">

								<div class="gf-product shop-grid-view-product">

									<div class="image">

												<a href="<?php echo base_url().str_replace(" ","-",$featp->mcat_name).'/details/'.str_replace(" ","-",$featp->title).'/'.$featp->pid;?>">

                                    <span class="onsale">Sale!</span>

                                    <img src="<?php echo base_url();?>assets/images/products/<?php echo $featp->img;?>" class="img-fluid" alt="">

												</a>

												<div class="product-hover-icons">

                    <a href="<?php echo $featp->pid;?>" class="wishlist" data-tooltip="Add to wishlist"> <span class="icon_heart_alt"></span> </a>

                     <a href="<?php echo $featp->pid;?>" data-tooltip="Quick view" data-toggle = "modal" data-target="#quick-view-modal-container" class="quick_view"> <span class="icon_search"></span> </a>

												</div>

											</div>

									 <div class="product-content">

												<!--<div class="product-categories">

													<a href="shop-left-sidebar.html">Fast Foods</a>,

													<a href="shop-left-sidebar.html">Vegetables</a>

												</div>-->

												<h3 class="product-title"><a href="<?php echo base_url().str_replace(" ","-",$featp->cat_name).'/details/'.str_replace(" ","-",$featp->title).'/'.$featp->pid;?>"><?php echo $featp->title;?></a></h3>

												<div class="price-box pbox<?php echo $featp->pid;?>">

                                                <?php if($featp->prod_type=="Normal"){if($featp->oprice!=""){?>

                        <span class="main-price"><i class="fa fa-inr"></i> <?php echo $featp->price;?></span>

                        <span class="discounted-price"><i class="fa fa-inr"></i><?php echo $featp->oprice;?></span>

                                                <?php }else{?>

                       <span class="discounted-price"><i class="fa fa-inr"></i><?php echo $featp->price;?></span>

                                                <?php }}else{$prices=explode(",",$featp->prices);$oprices=explode(",",$featp->oprices);

												if($featp->oprices!=""){?>

                       <span class="main-price"><i class="fa fa-inr"></i> <?php echo $prices[0];?></span>

                       <span class="discounted-price"><i class="fa fa-inr"></i><?php echo $oprices[0];?></span>

                                                <?php }else{?>

                       <span class="discounted-price"><i class="fa fa-inr"></i><?php echo $prices[0];?></span>

                                                <?php }}?>

												</div>

                                                <form action="" method="post" class="addtocart">

                                                <input type="hidden" name="pid" value="<?php echo $featp->pid;?>" />

                                                <input type="hidden" name="qty" value="1" />

                                                <div class="row">

                                                <div class="col-md-5">

                                                <?php if($featp->prod_type=="Variant"){$type=explode(",",$featp->packs);$colsize=7;?>

                                                <select name="type" class="form-control prod_type" id="<?php echo $featp->pid;?>"><?php

                                                $i=0;foreach($type as $t){

									echo '<option value="'.$i.'">'.$t.'</option>';

                                                $i++;}?></select><?php }else{$colsize=12;}?></div> <div class="col-md-<?php echo $colsize;?>">

                                                <button class="btn btn-xs btn-success"><i class="fa fa-shopping-cart"></i> Add to Cart</button>

                                                </div></div>

                                                </form>

											</div>

								</div>

							</div>

						<?php }}else{?>

                        <div class="col-md-8 col-md-offset-2 text-center">

                        <h1 style="font-size:50px;" class="text-danger">No Products Listed in this category...</h1><br/>

                        <a href="<?php echo base_url();?>" class="btn btn-lg btn-danger">Back To Home</a>

                        </div>

                        <?php }?>

					</div>



				</div>

			</div>

		</div>

	</div>

    <script>$(document).ready(function(){

<?php   $subcat="";

		if(is_numeric($this->uri->segment(3)) && is_numeric($this->uri->segment(4)) ){

		$cat=$this->uri->segment(3);$subcat=$this->uri->segment(4);$link=$cat.'-'.$subcat;

		}else{

		$cat=$this->uri->segment(2);}

		$link=$cat;?>

		var id="<?php echo $link;?>";

		$("a.page0").trigger("click");

		$(".page-number").click(function(e){e.preventDefault();

		$(".page-number").removeClass("active");

						 $(this).addClass("active");

		$("#ajaxpagination").html("<h1 class='text-center'>Loading Products.....</h1>");

		$('html, body').animate({

							scrollTop: $(".breadcrumb-container").offset().top

						}, 500);

							var id=$(this).attr("id");

							var href=$(this).attr("href");

							$.ajax({

									 type: "POST",

									 url: '<?php echo base_url();?>home/pagination',

									 data: {href:href,id:id},

									 success: function(res){

										$("#ajaxpagination").html(res);

									}

									 }); 

						});

	});

	</script>