📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv9.demodesign.com.tr
/
themes
/
default
📝
product.php
← Geri Dön
<?php m_header(); $informations = $db->table('products')->where('sef','=',m_u_g('sef'))->where('id','=',m_u_g('id'))->where('status','=',1)->get(); if($informations['total_count']=='0') { m_redirect(SITE_DOMAIN); } $info = $informations['data'][0]; $db->query("update products set views=views+1 where id='".$info['id']."'"); $undiscounted_price = m_currency($info['undiscounted_price']); $product_sale_price = m_currency($info['sale_price']); $product_currency_type = currency_types($info['currency_type'],'value'); $undiscounted_html = ''; if($undiscounted_price>0) { $indirim = 100-floor($product_sale_price/($undiscounted_price/100)); $undiscounted_html = '<div class="oldprice"><span>'.$undiscounted_price.' '.$product_currency_type.'</span><span class="discount ms-3">%'.$indirim.' İNDİRİM!</span></div>'; } if($info['b_id']!='0') { $brand_details = $db->table('brands')->where('id','=',$info['b_id'])->get_vars(); } $cat_products = $db->table('products')->where_set('c_id','LIKE',"'%".$info['c_id']."%'")->where('status','=',1)->order('rand()','')->limit(5)->get(); $product_variants = $db->table('product_variants')->where('p_id','=',$info['id'])->group('title')->order('title','asc')->get(); $product_comments = $db->table('comments')->where('p_id','=',$info['id'])->where('status','=',1)->order('id','desc')->get(); $product_specifications = $db->table('product_specifications')->where('p_id','=',$info['id'])->order('id','asc')->get(); $product_rating = $db->select('ROUND(AVG(rate),1) as rating')->table('comments')->where('p_id','=',$info['id'])->get(); $product_rating = $product_rating['data'][0]['rating']; if($product_rating=='') { $product_rating = 5; } ?> <style> button.submit.comment { padding: 20px 63px 20px 65px; border-radius: 2px; background-color: #00b37300; border: 2px solid #01b273 !important; color: #05b173 !important; font-size: 16px; font-weight: 600; text-align: left; color: #fff; border: 0; -webkit-transition: all 0.3s; transition: all 0.3s; margin-top: 0; text-align: center; } .variant { background: #eee; padding: 10px; border-radius: 5px; margin:5px 0; } .variant a{ color:black; } .active a{ color:white; } .variant:hover{ cursor:pointer; } .variants { margin-top: 10px; } .variant.active { background: #01b273; color: white; box-shadow: 0 0 5px 0px #05b173; } </style> <section class="product mt-5"> <div class="container-lg"> <div class="box"> <div class="row"> <div class="col-xl-6 col-lg-5"> <div class="productslider"> <?php for ($x = 1; $x <= 6; $x++) { $active = ''; if($x==1) { $active = 'active'; $image_url = $info['image']; } else { $image_url = $info['image_'.$x.'']; } if($image_url!='') { ?> <div> <img src="<?php echo m_image_url($image_url); ?>" class="img-fluid" alt="<?php echo $info['title']; ?>" style="width:402px; max-height:602px; margin:auto;"> </div> <?php } } ?> </div> <div class="productsliderthumb mt-3"> <?php for ($x = 1; $x <= 6; $x++) { $active = ''; if($x==1) { $active = 'active'; $image_url = $info['image']; } else { $image_url = $info['image_'.$x.'']; } if($image_url!='') { ?> <div> <img src="<?php echo m_image_url($image_url); ?>" class="img-fluid" alt="<?php echo $info['title']; ?>" > </div> <?php } } ?> </div> </div> <div class="col-xl-6 col-lg-7"> <h1 class="title mt-xl-0 mt-lg-0 mt-md-5 mt-sm-5 mt-5"><?php echo $info['title']; ?></h1> <div class="scrolllr"> <div class="d d-flex align-items-center justify-content-between scrollin"> <div class="l d-flex align-items-center me-xl-0 me-lg-0 me-md-0 me-sm-3 me-3"> <?= $info['product_text']?> </div> <div class="r d-flex align-items-center"> <span class="stock me-3"><?= $info['stock']-$info['stock']%10?>+ Stok</span> <?php if($info['stock_code']!='') { ?> <span class="code"><?php echo LG_STOCK_CODE; ?> : <?php echo $info['stock_code']; ?></span> <?php } ?> </div> </div> </div> <?= $undiscounted_html ?> <div class="price current-price" data-price="<?= $info['sale_price'] ?>" data-type="<?= $product_currency_type?>"><?php echo $product_sale_price; ?> <?php echo $product_currency_type; ?></div> <!--<span class="time"><i class="ri-timer-flash-line"></i> <b>16 saat 42 dakika</b> içinde sipariş verirseniz yarın kargoda</span> --> <?php if($product_variants['total_count']>0) { ?> <?php echo '<div class="variant-border"></div>'; foreach($product_variants['data'] as $variant) { $product_sub_variants = $db->table('product_variants')->where('p_id','=',$info['id'])->where('title','=',$variant['title'])->order('title','asc')->get(); ?> <div class="variants"> <div class="row mb-2 mt-2"><strong class="fw-bold"><?php echo $variant['title']; ?></strong></div> <div class="row"> <?php $n=0; foreach($product_sub_variants['data'] as $sub_variant) { $variant_active = ''; if($n==0) { $variant_active = 'active'; } $variant_price = $db->table("variants")->where("sef",'=',$sub_variant['content_sef'])->get(); echo ' <div class="col-auto"><div class="variant '.$variant_active.'"><a href="javascript:void(0);" class="product_variant product_variants_'.$info['id'].' '.$variant_active.'" rel="'.$variant['id'].'" data-variant_title="'.$sub_variant['title'].'" data-price="'.$variant_price['data'][0]['price'].'" data-variant_content="'.$sub_variant['content'].'">'.$sub_variant['content'].'</a></div></div>'; $n++; } ?> </div> </div> <?php }} ?> <div class="button-group d-flex align-items-center justify-content-between"> <div class="l d-flex align-items-center"> <div class="input-group number-count"> <span class="input-group-prepend"> <button type="button" class="btn btn-outline-secondary btn-number" disabled="disabled" data-type="minus" data-field="quant[1]"> <span class="fa ri-subtract-line"></span> </button> </span> <input type="text" name="quant[1]" class="form-control input-number qty-val" value="1" min="1" max="10"> <span class="input-group-append"> <button type="button" class="btn btn-outline-secondary btn-number" data-type="plus" data-field="quant[1]"> <span class="fa ri-add-line"></span> </button> </span> </div> <?php if($info['stock']>0) { ?> <a href="javascript:void(0)" class="btn-cart ms-3 button-add-to-cart add_cart" rel="<?php echo $info['id']; ?>"><i class="ri-shopping-basket-2-line"></i> <?php echo LG_ADD_CART; ?></a> <?php } else { ?> <style> .btn-cart2 { border-radius: 32px; background-color: #dc3444; padding: 19px 22px; font-size: 18px; font-weight: 500; color: #fff; display: flex; align-items: center; -webkit-transition: all 0.3s; transition: all 0.3s; } </style> <a href="javascript:void(0)" class="btn-cart2 btn-danger ms-3 button-add-to-cart" style="background:red;" rel="<?php echo $info['id']; ?>"><i class="ri-shopping-basket-2-line"></i> <?php echo LG_STOCK_NEWSLETTER; ?></a> <?php } ?> </div> <div class="r d-flex align-items-center"> <?php if(m_user_check() and $db->table('customer_favorites')->where('u_id','=',m_user('id'))->where('p_id','=',$info['id'])->count()>0) { ?> <a href="javascript:void(0)" class="btn-fav me-3 bg-danger text-white favorite_action" data-id="<?php echo $info['id']; ?>" title="<?php echo LG_ADD_FAVORITE; ?>"><i class="ri-star-line"></i></a> <?php } else { ?> <a href="javascript:void(0)" class="btn-fav me-3 favorite_action" data-id="<?php echo $info['id']; ?>" title="<?php echo LG_ADD_FAVORITE; ?>"><i class="ri-star-line"></i></a> <?php } ?> <?php if(m_user_check() and $db->table('customer_price_follows')->where('u_id','=',m_user('id'))->where('p_id','=',$info['id'])->count()>0) { ?> <a href="javascript:void(0)" class="btn-compare bg-danger text-white price_follow_action" data-id="<?php echo $info['id']; ?>" title="<?php echo LG_NOTIFY_WHEN_PRICE_DROPS; ?>"><i class="ri-money-dollar-circle-line"></i></a> <?php } else { ?> <a href="javascript:void(0)" class="btn-compare price_follow_action" data-id="<?php echo $info['id']; ?>" title="<?php echo LG_NOTIFY_WHEN_PRICE_DROPS; ?>"><i class="ri-money-dollar-circle-line"></i></a> <?php } ?> </div> </div> </div> </div> </div> </div> </section> <section class="product-detail mt-5"> <div class="container-lg"> <div class="card"> <div class="card-header"> <ul class="nav justify-content-center" id="pills-tab" role="tablist"> <li class="nav-item"> <button class="nav-link active" id="pills-tab1-t" data-bs-toggle="pill" data-bs-target="#pills-tab1" type="button" role="tab" aria-controls="pills-tab1" aria-selected="true">Ürün Özellikleri</button> </li> <li class="nav-item"> <button class="nav-link" id="pills-tab2-t" data-bs-toggle="pill" data-bs-target="#pills-tab2" type="button" role="tab" aria-controls="pills-tab2" aria-selected="false">Yorumlar</button> </li> <li class="nav-item"> <button class="nav-link" id="pills-tab4-t" data-bs-toggle="pill" data-bs-target="#pills-tab4" type="button" role="tab" aria-controls="pills-tab4" aria-selected="false"><?php echo LG_PRODUCT_SPECIFICATIONS; ?></button> </li> </ul> </div> <div class="card-body"> <div class="tab-content" id="pills-tabContent"> <div class="tab-pane fade show active" id="pills-tab1" role="tabpanel" aria-labelledby="pills-tab1"> <?php if($info['content']=='') { echo m_alert(LG_INFO,LG_PRODUCT_DESCRIPTION_NULL); } else { echo $info['content']; } ?> </div> <div class="tab-pane fade" id="pills-tab2" role="tabpanel" aria-labelledby="pills-tab2"> <div class="yorum-at mb-4"> <?php if(m_user_check()) { if($_POST) { if(m_u_p('content')=='' ) { echo m_alert(LG_ERROR,LG_PLEASE_FILL_ALL_FIELD); } else { $data = [ 'p_id' => $info['id'], 'u_id' => m_user('id'), 'rate' => 5, 'content' => m_u_p_msg('content'), 'date' => $db->now(), 'status' => 0 ]; $ok = 1; $query = $db->table('comments')->insert($data); echo m_alert(LG_SUCCESS,LG_COMMENT_SUCCESS_MESSAGE); } } ?> <form class="form-contact comment_form" action="<?php echo m_permalink('product',$info['sef'],$info['id']); ?>#product_reviews" method="post"> <strong>Sn. <span class="fw-bold "><?php echo m_user('name'); ?> <?php echo m_user('lastname'); ?> </span></strong> <textarea name="content" placeholder="<?php echo LG_COMMENT_PLACEHOLDER; ?>." style="margin-top:1rem;padding:18px;width:100%;min-height:100px;border: 1px solid rgb(191, 199, 223);border-radius: 2px;"></textarea> <div class="col-12"> <label class="d-flex align-items-center" style="opacity:0;">x</label> <button type="submit" class="submit comment w-100"><?php echo LG_SUBMIT; ?></button> </div> </form> <?php } ?> </div> <hr> <ul class="comments"> <?php if($product_comments['total_count']==0) { echo m_alert(LG_INFO,LG_PRODUCT_COMMENTS_NULL); } else { foreach($product_comments['data'] as $comment) { $author = m_comment_name_hide(''.m_user('name',$comment['u_id']).' '.m_user('lastname',$comment['u_id']).''); $date = m_date_to_tr($comment['date']); $content = $comment['content']; $rate = $comment['rate']*20; ?> <li> <div class="name"><?= $author ?> <span class="date"><?= $date ?></span></div> <p><?= $content ?></p> </li> <?php } } ?> </ul> </div> <div class="tab-pane fade" id="pills-tab4" role="tabpanel" aria-labelledby="pills-tab4"> <?php if($product_specifications['total_count']==0) { echo m_alert(LG_INFO,LG_PRODUCT_SPECIFICATION_NULL); } else { ?> <table class="font-md"> <tbody> <?php foreach($product_specifications['data'] as $specification) { echo ' <tr> <th>'.$specification['title'].'</th> <td> <p>'.$specification['content'].'</p> </td> </tr>'; } ?> </table> <?php } ?> </div> </div> </div> </div> </div> </section> <section class="bestsellers mt-5 pt-5 pb-5"> <div class="container-lg"> <div class="group d-flex align-items-center justify-content-between"> <div class="title"><?php echo LG_RELATED_PRODUCTS; ?></div> </div> <div class="row mt-5 row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-5 productlist"> <?php foreach($cat_products['data'] as $product) { $product_image = m_image_url($product['image']); $product_title = $product['title']; $product_link = m_permalink('product',$product['sef'],$product['id']); $undiscounted_price = m_currency($product['undiscounted_price']); $product_sale_price = m_currency($product['sale_price']); $product_currency_type = currency_types($product['currency_type'],'value'); $undiscounted_html = ''; if($undiscounted_price>0) { $undiscounted_html = '<span class="oldprice">'.$undiscounted_price.' '.$product_currency_type.'</span>'; } $cart_control = cart_control($product['id']); ?> <div class="col"> <div class="item"> <div class="img"> <?php if($product['cargo_price'] == "0.00"){ ?> <span class="d-flex bdgs"> <span class="bdg green">Ücretsiz Kargo!</span> </span> <?php } ?> <a href="<?php echo $product_link; ?>"> <img src="<?php echo $product_image; ?>" width="238" height="175" class="img-fluid" alt=""> </a> </div> <a href="<?php echo $product_link; ?>" class="title"><h3><?php echo $product_title; ?></h3></a> <div class="pb"> <?php echo $undiscounted_html ?> <div class="price"><?php echo $product_sale_price; ?> <?php echo $product_currency_type; ?></div> <?php echo $cart_control; ?> </div> </div> </div> <?php } ?> </div> </div> </section> <section class="whyus pt-5 pb-5"> <div class="container-lg"> <div class="title text-center">NEDEN <?php echo str_replace('https://','',SITE_DOMAIN); ?>?</div> <div class="row mt-5"> <?php $boxes_bottom = $db->table('boxes_bottom')->where('status','=',1)->order('b_rank','ASC')->get(); if($boxes_bottom['total_count'] != 0){ foreach($boxes_bottom['data'] as $boxes){ $title = $boxes['title']; $content = $boxes['content']; $color = $boxes['color']; $icon = $boxes['icon']; ?> <div class="col-xl-3 col-lg-3 col-md-6 col-sm-12 col-12"> <style> .subtitle-<?= $boxes['id']?>:before { content: ""; position: absolute; bottom: 0; width: 24px; height: 4px; border-radius: 2px; background-color: <?= $color?>; } </style> <div class="item orange" > <div class="subtitle subtitle-<?= $boxes['id']?>" style="color:<?= $color?>!important;" ><?= $title ?></div> <p><?= $content ?></p> </div> </div> <?php } } ?> </div> </div> </section> <?php m_footer(); ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula