ok
Direktori : /home2/selectio/www/thecomponents.in/ |
Current File : /home2/selectio/www/thecomponents.in/shop.php |
<?php include "header1.php"; $category_id =""; $WHERE =""; if(!empty($_GET['category'])){ $category_id.= $_GET['category']; $WHERE.= " WHERE products.category_id=$category_id"; } $query = $pdo->prepare("SELECT products.*,category.name AS category_name,product_variant.price FROM products LEFT JOIN category ON category.id=products.category_id LEFT JOIN product_variant ON product_variant.product_id=products.id".$WHERE); $query->execute(); $result = $query->fetchAll(PDO::FETCH_ASSOC); $totalData = $query->rowCount(); $query1 = $pdo->prepare("SELECT * FROM category "); $query1->execute(); $result_cat = $query1->fetchAll(PDO::FETCH_ASSOC); ?> <style> .category-dropdown.fixed .dropdown-box{ display: none; } </style> <main class="main"> <div class="page-header" style="background-image: url('images/shop/page-header-back.jpg'); background-color: #3C63A4;"> <h3 class="page-subtitle">Products</h3> <!--<h1 class="page-title">Classic Filter</h1>--> <!--<ul class="breadcrumb">--> <!-- <li><a href="#"><i class="d-icon-home"></i></a></li>--> <!-- <li class="delimiter">/</li>--> <!-- <li><a href="shop.html">Categories</a></li>--> <!-- <li class="delimiter">/</li>--> <!-- <li>Classic Filter</li>--> <!--</ul>--> </div> <div class="page-content mb-10 pb-6"> <div class="container"> <div class="row gutter-lg main-content-wrap"> <aside class="col-lg-3 sidebar sidebar-fixed sidebar-toggle-remain shop-sidebar sticky-sidebar-wrapper"> <div class="sidebar-overlay"></div> <a class="sidebar-close" href="#"><i class="d-icon-times"></i></a> <a href="#" class="sidebar-toggle"> <i class="fas fa-chevron-right"></i> </a> <div class="sidebar-content"> <div class="pin-wrapper" style="height: 1682.98px;"> <div class="sticky-sidebar" data-sticky-options="{'top': 10}" style="border-bottom: 0px none rgb(102, 102, 102); width: 272.5px;"> <div class="widget widget-collapsible"> <h3 class="widget-title">All Categories<span class="toggle-btn"></span></h3> <ul class="widget-body filter-items search-ul"> <?php foreach($result_cat as $category){ ?> <li><a href="category.php?category=<?=$category['id']?>"><?=$category['name']?></a></li> <?php } ?> </ul> </div> </div> </div> </div> </aside> <div class="col-lg-9 main-content"> <nav class="toolbox sticky-toolbox sticky-content fix-top"> </nav> <div class="row cols-2 cols-sm-3 product-wrapper"> <?php if($totalData>0){ foreach($result as $row_category){ ?> <div class="product-wrap"> <div class="product"> <figure class="product-media"> <a href="product.php?product=<?= $row_category['id'] ?>"> <img src="admin/<?=$row_category['image']?>" alt="product" width="280" height="315" style="height: 46% !important;"> </a> <div class="product-action-vertical"> <span class="btn-product-icon btn-cart" data-toggle="modal" data-target="#addCartModal" title="Add to cart"> <i class="d-icon-bag"></i> </span> </div> <div class="product-action"> <a href="#" class="btn-product btn-quickview" title="Quick View"> View </a> </div> </figure> <div class="product-details"> <div class="product-cat"> <span> <?=$row_category['category_name']?> </span> </div> <h3 class="product-name"> <a href="#"><?=$row_category['name']?></a> </h3> <div class="product-price"> <ins class="new-price"> <i class="bi bi-currency-rupee"></i> <?=$row_category['price']?> </ins> </div> <!--<div class="ratings-container"> <div class="ratings-full"> <span class="ratings" style="width:100%"></span> <span class="tooltiptext tooltip-top"></span> </div> <a href="product.html" class="rating-reviews">( 6 reviews )</a> </div>--> </div> </div> </div> <?php } ?> </div> </div> <?php }else {?> <div class="col=lg-12"> <img src="icons/no-products.png" style="margin-left: 90%;margin-top: 50%;"> </div> <?php } ?> </div> </div> </div> </main> <?php include "footer.php"; ?>