<title>Alışveriş Sepetim</title>
<meta name="keywords" content="<?php echo $ayar['sitekey']; ?>">
<meta name="description" content="<?php echo $ayar['sitedesc']; ?>">
<meta property="og:url" content="<?php echo $url; ?>"/>
<meta property="og:title" content="Alışveriş Sepetim"/>
<meta property="og:description" content="<?php echo $ayar['sitedesc']; ?>"/>
	
<main id="MainContent">
   <div id="shopify-section-breadcrumb" class="shopify-section laber_section laber-breadcrumb">
      <div class="breadcrumbs">
         <div class="container">
            <div class="outline-breadcrum">
               <div class="wrap-breadcrum h_left v_middle">
                  <div class="breadcrum text_left">
                     <ul class="list-unstyled ">
                        <li><a href="<?php echo $url;?>">Anasayfa</a></li>
                        <li><span>Alışveriş Sepetim</span></li>
                     </ul>
                  </div>
               </div>
            </div>
         </div>
      </div>

   </div>
 <div  id="shopify-section-template--18643475824925__main" style="background: white;" class="shopify-section cms_section contact-page">
   <section id="laber_template--18643475824925__main">
      <div class="container ">
       
         <!-- End Map Element -->  
         <div class="main-content shop-page">
            <div class="content-form" style="padding-top: 30px;">
               <div class="row pr_center ">
             
			    <?php if($sepetsayi<='0'){?>
                  <div class="col-md-12">
                     <div class="bossepet">
                        <img src="<?php echo $sitetemasi;?>/extra/bos.jpg"></img>
                        <h6 style="font-weight: 500;font-size: 20px;">SEPETİNİZDE ÜRÜN BULUNAMADI</h6>
                        <span>Binlerce ürünü büyük indirimlerle satın almak için hemen alışverişe başlayın.</span>
						<a href="<?php echo $url;?>" style="color: white;" class="btn btn-success btn-theme-2">
                        ALIŞVERİŞE BAŞLA </a>
                     </div>
                  </div>
                  <?php } else { ?>
                  <div class="fluid-container">
                     <div class="container cart-container my-4">
                        <div class="row mb-3">
                           <div class="col-sm-9 col-12 okey">
                              <div class="cart-container-left">
							  
							  <?php if($toplamtutarim>=$system['ucretsizkargo']){?>
<div class="alert alert-success alert-dismissible" style="background-color: #f1f5f6;
  border-color: #ffd369 !important;
  border-radius: 6px;
  margin-bottom: 15px;
  color: #333;
  padding: 16px;">
<i class="fa fa-check"></i> Tebrikler! <b>KARGO ÜCRETSİZ</b> fırsatını yakaladınız!
</div>
<?php } else { ?>
<div class="alert alert-warning alert-dismissible" style="background-color: #e7e7e7;
  border-color: <?php echo $tema['t37'];?> !important;
  background-color: #f1f5f6;
  border-color: #ffd369 !important;
  border-radius: 6px;
  margin-bottom: 15px;
  color: #333;
  padding: 16px;">
<i class="fa fa-exclamation-circle"></i> <b style="font-weight: 500;">Sepetine <b><?php echo $kalan = $system['ucretsizkargo']-$toplamtutarim;?> TL'lik</b> daha ürün ekle KARGON BİZDEN 🙂</b>
</div>
<?php } ?>
							  
							  
                                 <?php
                                    $sepetebak = $ozy->prepare("SELECT * FROM sepet WHERE kim=? AND gelenkim=?");
                                    $sepetebak->execute(array($ip, $sepetimdekikim));
                                    
                                    if ($sepetebak->rowCount()) {
                                        $uyesepeti = $ozy->prepare("SELECT * FROM urunler 
                                                      INNER JOIN sepet ON urunler.id = sepet.urunid  
                                                      WHERE sepet.kim=? AND sepet.gelenkim=? ORDER BY sepet.id DESC");
                                        $uyesepeti->execute(array($ip, $sepetimdekikim));
                                    
                                        foreach ($uyesepeti as $sepet) {
                                            $newstok = ($sepet['alodedurum'] == '1') ? $sepet['adet'] + $sepet['alodeadet'] : $sepet['adet'];
                                            $maxstok = ($system['sinirsizstok'] != '1') ? $sepet['stok'] : '9999999999999999999'; 
                                    ?>
                                 <div class="cart-product-container">
                                    <div class="cart-product-container-left">
                                       <img src="resimler/urunler/<?php echo $sepet['resim']; ?>">
                                    </div>
                                    <div class="cart-product-container-middle">
                                       <div class="row">
                                          <div class="col-12 cart-product-title">
                                             <a href="urun/<?php echo $sepet['seo']; ?>">
                                                <h2><?php echo $sepet['adi']; ?></h2>
                                             </a>
                                          </div>
                                          <div class="col-12 cart-product-variant-title mb-2">
                                             <h3><?php echo $sepet['ekurun']; ?></h3>
                                          </div>
                                          <div class="col-12 mb-1 cart-product-quantity"><b><?php echo fiyatgoster($sepet['fiyat']);?> x <?php echo $sepet['adet']; ?> Adet </b></div>
                                          <div class="col-12 cart-product-prices">
                                             <span class="fw-bold active-color newfiyat"><?php echo fiyatgoster($sepet['fiyat'] * $sepet['adet']); ?></span>
                                          </div>
                                          <?php if ($sepet['kargo'] == '1') { ?>
                                          <span class="badge">
                                          <i class="fa fa-truck"></i> ÜCRETSİZ KARGO
                                          </span>
                                          <?php } ?>
                                          <?php if ($sepet['alodedurum'] == '1') { ?>
                                          <span class="badge">
                                          <i class="fa fa-gift"></i> <?php echo $sepet['alodemetin']; ?>
                                          </span>
                                          <?php } ?>
                                       </div>
                                    </div>
                                    <div class="cart-product-container-right">
                                       <form action="" method="POST">
                                          <div class="cart-product-quantity-changer">
                                             <a id="AdetArttir<?php echo $sepet['id']; ?>">
                                                <div class="cart-product-quantity-changer-increaser">
                                                   <i class="fa fa-plus"></i>
                                                </div>
                                             </a>
                                             <div class="cart-product-quantity-changer-quantity">
                                                <input class="submit_on_enter" type="text" data-type="number" pattern="[0-9]*"
                                                   id="NormalAdeti<?php echo $sepet['id']; ?>" onchange="this.form.submit()" name="adet"
                                                   value="<?php echo $newstok; ?>" min="1" max="<?php echo $maxstok; ?>" size="2">
                                             </div>
                                             <a id="AdetAzalt<?php echo $sepet['id']; ?>">
                                                <div class="cart-product-quantity-changer-decreaser">
                                                   <i class="fa fa-minus"></i>
                                                </div>
                                             </a>
                                          </div>
                                          <input type="hidden" name="sepetupdate" value="<?php echo $sepet['id']; ?>" />
                                          <input type="hidden" name="sepetid" value="<?php echo $sepet['id']; ?>" />
                                          <input type="hidden" name="urunid" value="<?php echo $sepet['urunid']; ?>" />
                                          <button name="deletex" type="submit" style="background: white;" class="cart-product-remove">
                                          <i class="fa fa-trash"></i>
                                          </button>
                                       </form>
                                    </div>
                                 </div>
                                 <?php
                                    } 
                                    }
                                    ?>
                              </div>
							  


		<div class="row">
    
    <div class="col-sm-6 col-12">
<form method="POST" action="" style="border: 2px solid #f5f5f5; padding: 10px; border-radius: 6px;">
  <div class="form-group" style="display: flex;height: 50px;">
    <input type="text" class="form-control" name="kuponadi" placeholder="İndirim Kuponu Kodunuz" style="flex: 1;
  border: none !important;
  background: #f1f5f6;
  padding: 5px;
    padding-left: 5px;
  border-radius: 6px;
  padding-left: 10px">
    <button class="kuponbuton btn btn-primary" style="background: #ff5000 !important;
  border: none;
  margin-left: 10px;
  color: white;
  border-radius: 6px;
  font-weight: 600;" type="submit" name="kuponguncelle">Kuponu Uygula</button>
  </div>
</form>

	</div>
   
    
	<?php if ($_SESSION['uyegirisdurumu'] == 'true') { ?>
	
	
<style>
.hediyeceki {
 width: 49%;
  border: 2px solid #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  margin: 0px !important;
  background: #fff;
}	
@media screen and (max-device-width: 480px) and (orientation: portrait){
.hediyeceki {
  width: 96% !important;
  border: 2px solid #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  margin: auto !important;;
    margin-top: auto;
    margin-bottom: auto;
  margin-top: 10px !important;;
  margin-bottom: 10px !important;;
}
}	
	</style>
	
	
	
	<form method="POST" action="" class="hediyeceki">    
	<div class="col-sm-6 col-12" style="width: 100% !important;
  max-width: 100% !important;">
      <div class="form-group">
          <select name="kuponadi" class="form-control" style="font-weight: 400;
  border: none !important;
  background: #f1f5f6;
  padding: 5px;
    padding-left: 5px;
  border-radius: 6px;
  padding-left: 10px;
  width: 100%;
  height: 50px;" onchange='this.form.submit()'>
            <option value="0">Aktif Hediye Çeklerim</option>
            <?php
              $uyeepostamiz = temizle($uyebilgileri['email']);
              $cekoku = $ozy->query("select * from kuponlar where durum='1' and sekil='1' and epostalar like '%$uyeepostamiz%' and gtarih>='$buguntarihim' and kullanildi not like '%$uyeepostamiz%' order by id DESC")->fetchAll(PDO::FETCH_ASSOC);
              foreach ($cekoku as $hediyecek) {
            ?>
              <option value="<?php echo $hediyecek['adi']?>"><?php echo $hediyecek['adi']?></option>
            <?php } ?>
          </select>
          <input type="hidden" name="cekguncelle">
        </div>
	

	</div>
		</form>
	<?php } ?>
	
	
  </div>


                           </div>
                           <div class="col-sm-3 col-12">
                              <div class="cart-container-right">
                                 <div class="row">
                                    <div class="col-12 px-0 mb-3">
                                    
                                       <div class="cart-summary">
                                          <h2>Sipariş Özeti</h2>
                                          <table cellspacing="0" cellpadding="0">
                                             <tbody>
                                                <tr>
                                                   <td class="black">Ara Tutar :</td>
                                                   <td class="text-end"><?php echo $aratutari;?></td>
                                                </tr>
                                                <tr>
                                                   <td class="black">KDV :</td>
                                                   <td class="text-end"><?php echo $kdvtutari;?></td>
                                                </tr>
                                                <tr>
                                                   <td class="black">Kargo Bedeli :</td>
                                                   <td class="text-end"><?php echo $kargometni;?></td>
                                                </tr>
                                                <?php if($kuponindirim!='0'){?>
                                                <tr>
                                                   <td class="black">İndirim Bedeli :</td>
                                                   <td class="text-end" style="color: red !important;">- <?php echo fiyatgoster($kuponindirim)?> <a style="padding:2px;font-size: 12px;background: #dd1616a8;color: white;" href="sepet/?kuponsil">x</a></td>
                                                </tr>
                                                <?php } ?>
                                                <?php if($cekindirim!='0'){?>
                                                <tr>
                                                   <td class="black">Çek İndirimi :</td>
                                                   <td class="text-end" style="color: red !important;">- <?php echo fiyatgoster($cekindirim)?> <a style="padding:2px;font-size: 12px;background: #dd1616a8;color: white;" href="sepet/?ceksil">x</a></td>
                                                </tr>
                                                <?php } ?>
                                                <tr>
                                                   <td colspan="2">
                                                      <hr>
                                                   </td>
                                                </tr>
                                                <tr>
                                                   <td class="black">Ödenecek Tutar :</td>
                                                   <td class="cart-summary-total-price"><?php echo $toplamtutari;?></td>
                                                </tr>
                                             </tbody>
                                          </table>
                                       </div>
                                    </div>
                                    <div class="col-12 mb-3 px-0">
                                       <?php if ($_SESSION['uyegirisdurumu'] == 'true') { ?>
                                       <a href="odeme/">
                                          <div class="butonok" style="background:<?php echo $tema['t37'];?>;color: white;">
                                             <span class="me-3">Sepeti Onayla</span><span> <i class="fa fa-arrow-right">
                                             </i></span>
                                          </div>
                                       </a>
                                       <?php } else { ?>
                                       <a href="kontrol/">
                                          <div class="butonok" style="background:<?php echo $tema['t37'];?>;color: white;">
                                             <span class="me-3">Sepeti Onayla</span><span> <i class="fa fa-arrow-right">
                                             </i></span>
                                          </div>
                                       </a>
                                       <?php } ?>
                                    </div>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <div class="row"></div>
                     </div>
                  </div>
                  <?php } ?>
			 
               </div>
            </div>
         </div>
      </div>
   </section>
   <style data-shopify="">#laber_template--18643475824925__main {padding-top:;		 padding-right:; padding-bottom: 80px ; padding-left:;		 	 	}@media only screen and (max-width: 1024px) {		#laber_template--18643475824925__main {padding-top: ;padding-right: ;padding-bottom: 40px;padding-left: ;}	}</style>
</div>

</main>
<style>
   .bossepet {
   display:flex;
   justify-content:center;
   align-items:center;
   flex-direction:column;
   min-height:300px;
   font-size:14px;
   width: 100%;
   padding-bottom: 100px;
   padding-top: 20px;
   text-align: center;
   }
   .bossepet img{
   width: 200px;
   margin-bottom: 10px;
   }
   .bossepet .btn {
   font-size: 16px;
   margin-top: 15px;
   font-weight: 500;
   border-radius: 5px;
   background: <?php echo $tema['t37'];?> !important;
   border: none;
   padding: 10px;
   padding-right: 30px;
   padding-left: 30px;
   }
   .cart-container {
   padding:0
   }
   .cart-container,
   .cart-container-title {
   width:100%;
   height:auto
   }
   .cart-container-title h1 {
   font-size:22px;
   color:#555
   }
   .cart-container-left {
   position:relative;
   float:left;
   width:100%;
   height:auto
   }
   .cart-container-right {
  height: auto;
  border-radius: 6px;
   }
   .cart-product-container {
   position:relative;
   float:left;
   width:100%;
   height:auto;
   border:2px solid #f5f5f5;
   background-color:#fff;
   border-radius:5px;
   padding:15px;
   margin-bottom:15px;
   z-index: 9;
   }
   .cart-product-container-left {
   position:relative;
   float:left;
   width:100px;
   height:auto
   }
   .cart-product-container-left img {
   width:100%;
   height:120px;
   -o-object-fit:cover;
   object-fit:cover;
   border-radius:5px
   }
   .cart-product-container-middle {
   position:relative;
   float:left;
   width:calc(100% - 140px);
   height:auto;
   padding-left:20px
   }
   .cart-product-container-right {
   position:relative;
   float:left;
   width:40px;
   height:auto;
   margin-top: 2% !important;
   }
   .cart-product-title>a {
   text-decoration:none
   }
   .cart-product-title h2 {
   font-size:15px;
   margin-bottom:3px;
   color:#555;
   font-weight:500;
   }
   .cart-product-variant-title h3 {
   color:#555;
   font-weight:400;
   font-size:12px;
   margin-bottom:0;
   line-height: 16px;
   }
   .cart-product-quantity-changer {
   width:100%;
   height:100px;
   border:1px solid <?php echo $tema['t37'];?> !important;
   border-radius:10px
   }
   .cart-product-quantity-changer-decreaser,
   .cart-product-quantity-changer-increaser,
   .cart-product-quantity-changer-quantity {
   height:40px;
   text-align:center;
   font-size:10px;
   color:#777;
   width:100%;
   cursor:pointer
   }
   .cart-product-quantity-changer-quantity {
   height:20px
   }
   .cart-product-quantity-changer-decreaser:hover,
   .cart-product-quantity-changer-increaser:hover {
   color:#000
   }
   .cart-product-quantity-changer-decreaser,
   .cart-product-quantity-changer-increaser {
   line-height:40px
   }
   .cart-product-quantity-changer-quantity input[type=text] {
   width: 100%;
   height: 20px !important;
   text-align: center;
   border: none;
   font-size: 13px;
   font-weight: 500;
   color: #555 !important;
   padding: 0px !important;
   }
   .cart-product-remove {
   width:40px;
   height:40px;
   line-height:40px;
   text-align:center;
   border:1px solid #e0e0e0;
   border-radius:5px;
   margin-top:5px;
   font-size:14px;
   color:#777;
   cursor:pointer;
   line-height: 0px;
   display: block !important;
   }
   .cart-product-remove:hover {
   border:1px dashed var(--themeColor);
   color:var(--themeColor)
   }
   .cart-product-quantity {
   font-size:12px;
   color:#555;
   font-weight:400
   }
   .text-end {
   font-size: 14px;
   font-weight: 500;
   }	
   .product-card-min {
   position:relative;
   float:left;
   display:block;
   width:150px;
   height:auto;
   background:#fff;
   border-radius:10px;
   margin-right:0;
   transition:transform .3s
   }
   .product-card-min:hover {
   transform:scale(1)
   }
   .product-card-min a {
   text-decoration:none
   }
   .product-card-min>img {
   vertical-align:baseline!important;
   width:100%;
   height:245px;
   border-radius:5px;
   -o-object-fit:cover;
   object-fit:cover;
   -o-object-position:50% 50%;
   object-position:50% 50%
   }
   .product-card-min-image {
   width:100%
   }
   .product-card-min-image img {
   width:100%;
   height:200px;
   -o-object-fit:cover;
   object-fit:cover;
   border-radius:5px
   }
   .product-card-min-image img:first-child {
   display:block
   }
   .product-card-min-image img:last-child {
   display:none
   }
   .product-card-min:hover>.product-card-min-image img:last-child {
   display:block
   }
   .product-card-min:hover>.product-card-min-image img:first-child {
   display:none
   }
   .product-card-min-title {
   width:100%;
   height:25px;
   line-height:25px;
   margin-top:5px;
   padding:0 10px;
   color:#777;
   font-size:13px;
   word-wrap:break-word;
   overflow-wrap:break-word;
   white-space:nowrap;
   overflow:hidden;
   text-overflow:ellipsis
   }
   .product-card-min-price {
   width:100%;
   height:25px;
   position:relative;
   padding:0 10px
   }
   .product-card-min-price1 {
   font-weight:500;
   color:var(--themeColor)
   }
   .product-card-min-price1,
   .product-card-min-price2 {
   float:left;
   height:25px;
   line-height:25px;
   font-size:14px
   }
   .product-card-min-price2 {
   text-decoration:line-through;
   color:#999;
   margin-right:5px
   }
   .message-container {
   position:fixed;
   top:10px;
   right:10px;
   width:250px;
   height:auto;
   z-index:15
   }
   .message-box {
   height:auto;
   background:#fff;
   font-size:12px;
   box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
   margin-bottom:10px
   }
   .cart-confirm,
   .message-box {
   width:100%;
   padding:10px 15px;
   border-radius:5px;
   color:#fff;
   font-weight:500
   }
   .cart-confirm {
   background: <?php echo $tema['t37'];?>;
   text-align: center;
   font-size: 16px;
   cursor: pointer;
   margin-bottom: 30px;
   }
   .cart-confirm-disabled {
   background:#bdbdbd;
   cursor:not-allowed
   }
   .cart-gift-certificate-container {
   width:100%;
   height:auto;
   padding:15px;
   background:#f5f5f5;
   box-shadow:0 1px 3px rgb(0 0 0/20%);
   border-radius:3px
   }
   .cart-gift-certificate-container h2 {
   font-size:14px;
   color:#555;
   font-weight:400;
   padding-bottom:10px
   }
   .cart-summary {
   width: 100%;
  height: auto;
  padding: 15px 20px;
    padding-top: 15px;
  background: #fff;
  border: 1px solid <?php echo $tema['t37'];?>;
  border-radius: 6px;
  padding-top: 5px;
   }
   
   
   .black {
   font-weight: bold;
    }
   
   
   .cart-summary h2 {
  font-size: 16px;
  margin-bottom: 10px;
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
  background: #f1f5f6;
  padding: 18px;
  border-radius: 6px;
   }
   .cart-summary table {
   width:100%;
   height:auto
   }
   .cart-summary table tr {
   height: 40px;
  line-height: 1px;
  font-size: 14px;
  color: #555;
   }
   .cart-summary-total-price, .cart-product-prices span {
   text-align: right;
   color: var(--color-current-product);
   font-size: 17px;
   font-weight: bold !important;
   }
   .cart-recommended-products-container,
   .cart-recommended-products-title {
   width:100%;
   height:auto
   }
   .cart-recommended-products-title h2 {
   font-size:20px;
   color:#555
   }
   .cart-recommended-products {
   width:100%;
   height:auto;
   overflow-x:auto;
   overflow-y:hidden;
   white-space:nowrap;
   -webkit-overflow-scrolling:touch;
   padding-bottom:10px
   }
   .link-block {
   width: 120px;
   text-decoration: none;
   color: #fff;
   font-size: 12px;
   }
.badge {
 width: 16%;
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: #1f1d1d;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.8px;
  border: 1px solid #e6e0e0;
  padding: 12px;
  border-radius: 5px;
  background: #f7f9fc;
  margin-right: 8px;
}

.kuponbuton {
width: 32% !important;	
}

@media screen and (max-device-width: 480px) and (orientation: portrait){
	
.kuponbuton {
width: 32% !important;	
}	
	
	
  .badge {
  width: 75% !important;  
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: #1f1d1d;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.8px;
  border: 1px solid #eaeaea;
  padding: 12px;
  border-radius: 5px;
  background: #dddada;
  margin-right: 8px;
}
}		
	

</style>
<script src="<?php echo $sitetemasi;?>/extra/jquery.min.js"></script>
<script src="<?php echo $sitetemasi;?>/extra/bootstrap-input-spinner.js"></script>
<?php
   $sepetebak = $ozy->prepare("SELECT * FROM sepet WHERE kim=? AND gelenkim=?");
   $sepetebak->execute(array($ip, $sepetimdekikim));
   
   if ($sepetebak->rowCount()) {
       $uyesepeti = $ozy->prepare("SELECT * FROM urunler 
                     INNER JOIN sepet ON urunler.id = sepet.urunid  
                     WHERE sepet.kim=? AND sepet.gelenkim=? ORDER BY sepet.id DESC");
       $uyesepeti->execute(array($ip, $sepetimdekikim));
   
       foreach ($uyesepeti as $sepet) {
   ?>
<script type="text/javascript">
   jQuery(document).ready(function ($) {
       $("#AdetArttir<?php echo $sepet['id'];?>").on("click", function () {
           var adet = $("#NormalAdeti<?php echo $sepet['id'];?>").val();
           adet++;
           $("#NormalAdeti<?php echo $sepet['id'];?>").val(adet);
           updateCart(<?php echo $sepet['urunid'];?>, adet, <?php echo $sepet['id'];?>);
       });
   
       $("#AdetAzalt<?php echo $sepet['id'];?>").on("click", function () {
           var adet = $("#NormalAdeti<?php echo $sepet['id'];?>").val();
           if (adet > 1) { // Değişiklik burada yapıldı, adet 1'den küçük olmaması sağlandı
               adet--;
               $("#NormalAdeti<?php echo $sepet['id'];?>").val(adet);
               updateCart(<?php echo $sepet['urunid'];?>, adet, <?php echo $sepet['id'];?>);
           }
       });
   
       $("#NormalAdeti<?php echo $sepet['id'];?>").keypress(function (e) {
           var regex = new RegExp("^[0-9]");
           var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
           if (regex.test(str)) {
               return true;
           }
           e.preventDefault();
           return false;
       });
   
       function updateCart(urunid, adet, sepetid) {
           $.ajax({
               type: "POST",
               url: "sepet_update.php", // Değiştirilecek olan dosya adı veya URL
               data: { sepetupdate: true, urunid: urunid, adet: adet, sepetid: sepetid },
               success: function (response) {
                   location.reload();                              
               }
           });
       }
   });
</script>
<?php }}?> 