<?php
*/
session_start();
switch ($_SESSION['ship_type']) {
case 'motokurye':
add_action( 'woocommerce_cart_calculate_fees','woocommerce_cus tom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$motokurye = get_theme_mod('gk_woo_moto_shipping_price');
$woocommerce->cart->add_fee( 'Moto Kurye Ücreti', $motokurye, true, '' );
}
break;
case 'defaultship':
add_action( 'woocommerce_cart_calculate_fees','woocommerce_cus tom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$motokurye = '19.90';
$woocommerce->cart->add_fee( 'Kargo Ücreti', $motokurye, true, '' );
}
break;
case 'freeship':
add_action( 'woocommerce_cart_calculate_fees','woocommerce_cus tom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$motokurye = '0';
$woocommerce->cart->add_fee( 'Kargo creti', $motokurye, true, '' );
}
break;
}
add_action( 'woocommerce_thankyou', 'bbloomer_add_content_thankyou' );
function bbloomer_add_content_thankyou($order_id) { ?>
<?php
session_start();
// Kargo tipini sıfrla //
$_SESSION['ship_type'] = "";
// Kargo tipini sıfırla //
?>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<?php
if ($_POST["createHelp"]) {
$to = get_theme_mod('gk_woo_ticket_send_email');
$subject = "1 Yeni ürün sipariş destek talebi";
$headers = array('Content-Type: text/html; charset=UTF-8');
$message = '<h3>Web sitesi adresi: '.get_home_url().' üzerinden bir yeni sipariş destek talebiniz var.</h3>
<br><strong>Sipari ID:</strong> '.$order_id.'<br>
<strong>Sipariş detayları:</strong> <a href="https://popilero.com/wp-admin/post.php?post='.$order_id.'&action=edit">Sipari detaylarını görüntüleyin</a><br>
<strong>Destek talep mesajı:</strong>'.$_POST["orderHelpMessage"].'<br>
<strong>Üye K.adı:</strong> '.get_user_meta(get_current_user_id(), 'nickname', true).'<br>
<strong>Tarih / Saat:</strong> '.date('d.m.Y H:i:s').'<br>
<p>Bu mesaj site tarafından otomatik olarak gnderilmiştir, lütfen cevaplamayınız</p>
<p>'.get_home_url().'<p>';
$sent = wp_mail($to, $subject, $message, $headers);
if($sent) { ?>
<script type="text/javascript">
Swal.fire(
'İşlem Tamamlandı',
'Destek talebiniz ilgili birim epostasına gnderildi. En kısa sürede sizinle iletişime geçilecektir. Teşekkr ederiz.',
'success',
)
</script>
<?php } else { ?>
<script type="text/javascript">
Swal.fire(
'Hata',
'Destek talebiniz oluşturulurken bir hata meydana geldi. Lütfen daha sonra tekrar deneyiniz.',
'error'
)
</script>
<?php }
}
?>
<script type="text/javascript">
function showExample(){
Swal.fire({
title: 'Destek Talebi',
showCancelButton: false,
showConfirmButton: false,
html: `<form method="POST" name="createHelp">Sipariş Numarası<br><input type="text" class="swal2-input" id="orderID" value="<?php echo $order_id; ?>" disabled>Talep Mesajınız<br><textarea class="swal2-textarea" name="orderHelpMessage" placeholder="Destek talep mesajnızı buraya yazınız"></textarea><input class="swal2-confirm swal2-styled" name="createHelp"type="submit" value="İşlemi tamamla"></form>`,
});
}
</script>
<section class="thankyou_custom">
<div class="container">
<img src="https://popilero.com/wp-content/uploads/2021/01/popilero-logo.png">
<h3>Siparişiniz başarıyla oluşturuldu</h3>
<p>Siparişiniz sistem tarafından başarıyla oluturuldu. Siparişiniz için popilero olarak teşekkür ederiz.</p>
<div class="row">
<div class="col-md-5">
<span class="ordercode">Sipariş Kodunuz: <b><?php echo $order_id; ?></b></span>
</div>
<div class="col-md-4">
<a href="<?php echo esc_url( wc_get_account_endpoint_url( 'orders' ) ); ?>" class="allorders">Tüm Siparişlerinizi Görüntüleyin</a>
</div>
<div class="col-md-3">
<a href="#" onclick="showExample()" class="destek">Destek & İletişim</a>
</div>
</div>
</div>
</section>
<?php }
// Teslimat bilgisi alanlarından bazların kaldır //
add_filter( 'woocommerce_checkout_fields' , 'gk_remove_checkout_fields' );
function gk_remove_checkout_fields( $fields ) {
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_postcode']);
unset($fields['shipping']['shipping_company']);
unset($fields['shipping']['shipping_postcode']);
return $fields;
}
// Teslimat bilgisi alanlarından bazıların kaldır //
// Show order metabox admin page //
add_action( 'woocommerce_admin_order_data_after_order_details' , 'gk_admin_show_corporate_metabox' );
function gk_admin_show_corporate_metabox( $order ){ ?>
<br class="clear" />
<h4>Kurumsal Bilgiler <a href="#" class="edit_address">Edit</a></h4>
<?php echo get_post_meta( $order->get_id(), 'order_val_gokhan', true ); ?>
<?php
$order_val_company_name = get_post_meta( $order->get_id(), 'order_val_company_name', true );
$order_val_tax_number = get_post_meta( $order->get_id(), 'order_val_tax_number', true );
$order_val_tax_administration = get_post_meta( $order->get_id(), 'order_val_tax_administration', true );
?>
<div class="address">
<p><strong>Firma Ünvan:</strong><?php echo $order_val_company_name; ?></p>
<p><strong>Vergi Numarası:</strong> <?php echo $order_val_tax_number; ?></p>
<p><strong>Vergi Dairesi:</strong> <?php echo $order_val_tax_administration; ?></p>
</div>
<div class="edit_address">
<p class="form-field form-field-wide">
<?php
woocommerce_wp_text_input( array(
'id' => 'order_val_company_name',
'label' => 'Firma Ünvanı:',
'value' => $order_val_company_name,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
<p class="form-field form-field-wide">
<?php
woocommerce_wp_text_input( array(
'id' => 'order_val_tax_number',
'label' => 'Vergi Numarası:',
'value' => $order_val_tax_number,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
<p class="form-field form-field-wide">
<?php
woocommerce_wp_text_input( array(
'id' => 'order_val_tax_administration',
'label' => 'Vergi Dairesi:',
'value' => $order_val_tax_administration,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
</div>
<br class="clear" />
<h4>Gönderi Teslimat Tarihi <a href="#" class="edit_address">Edit</a></h4>
<?php
$order_val_shipping_set_date = get_post_meta( $order->get_id(), 'order_val_shipping_set_date', true );
?>
<div class="address">
<p><strong>Gönderi Teslimat Tarihi:</strong><?php echo $order_val_shipping_set_date; ?></p>
</div>
<div class="edit_address">
<p class="form-field form-field-wide">
<?php
woocommerce_wp_textarea_input( array(
'id' => 'order_val_shipping_set_date',
'label' => 'Gönderi Teslimat Tarihi',
'value' => $order_val_shipping_set_date,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
</div>
<br class="clear" />
<h4>Hediye Not Bilgileri <a href="#" class="edit_address">Edit</a></h4>
<?php
$order_val_gift_text = get_post_meta( $order->get_id(), 'order_val_gift_text', true );
$order_val_send_name_surname = get_post_meta( $order->get_id(), 'order_val_send_name_surname', true );
?>
<div class="address">
<p><strong>Hediye Notu:</strong><?php echo $order_val_gift_text; ?></p>
<p><strong>Gönderen Adı Soyad:</strong> <?php echo $order_val_send_name_surname; ?></p>
</div>
<div class="edit_address">
<p class="form-field form-field-wide">
<?php
woocommerce_wp_textarea_input( array(
'id' => 'order_val_gift_text',
'label' => 'Hediye Notu',
'value' => $order_val_gift_text,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
<p class="form-field form-field-wide">
<?php
woocommerce_wp_text_input( array(
'id' => 'order_val_send_name_surname',
'label' => 'Gönderen Adı Soyadı',
'value' => $order_val_send_name_surname,
'wrapper_class' => 'form-field-wide'
) );
?>
</p>
</div>
<?php }
// All Form value save //
add_action('woocommerce_checkout_update_order_meta ', 'custom_checkout_field_update_order_meta');
function custom_checkout_field_update_order_meta($order_id) {
if (!empty($_POST['order_val_company_name'])) {
update_post_meta($order_id, 'order_val_company_name',sanitize_text_field($_POS T['order_val_company_name']));
}
if (!empty($_POST['order_val_tax_number'])) {
update_post_meta($order_id, 'order_val_tax_number',sanitize_text_field($_POST['order_val_tax_number']));
}
if (!empty($_POST['order_val_tax_administration'])) {
update_post_meta($order_id, 'order_val_tax_administration',sanitize_text_field ($_POST['order_val_tax_administration']));
}
if (!empty($_POST['order_val_gift_text'])) {
update_post_meta($order_id, 'order_val_gift_text',sanitize_text_field($_POST['order_val_gift_text']));
}
if (!empty($_POST['order_val_send_name_surname'])) {
update_post_meta($order_id, 'order_val_send_name_surname',sanitize_text_field( $_POST['order_val_send_name_surname']));
}
if (!empty($_POST['order_val_shipping_set_date'])) {
update_post_meta($order_id, 'order_val_shipping_set_date',sanitize_text_field( $_POST['order_val_shipping_set_date']));
}
}
// All Form value save //
function misha_save_general_details( $ord_id ){
update_post_meta( $ord_id, 'order_val_company_name', wc_clean( $_POST[ 'order_val_company_name' ] ) );
update_post_meta( $ord_id, 'order_val_tax_number', wc_clean( $_POST[ 'order_val_tax_number' ] ) );
update_post_meta( $ord_id, 'order_val_tax_administration', wc_clean( $_POST[ 'order_val_tax_administration' ] ) );
update_post_meta( $ord_id, 'order_val_gift_text', wc_clean( $_POST[ 'order_val_gift_text' ] ) );
update_post_meta( $ord_id, 'order_val_send_name_surname', wc_clean( $_POST[ 'order_val_send_name_surname' ] ) );
update_post_meta( $ord_id, 'order_val_shipping_set_date', wc_clean( $_POST[ 'order_val_shipping_set_date' ] ) );
}
add_action( 'woocommerce_process_shop_order_meta', 'misha_save_general_details' );
// Show order metabox admin page //
// Plugin settings//
include ('wplugin-settings.php');
function woo_elements_set_style() {
?>
<style type="text/css">
form.cart{display:-webkit-box;display:-ms-flexbox;display:flex;}
form.cart input[type='number']{-moz-appearance:textfield;}
form.cart input::-webkit-outer-spin-button,
form.cart input::-webkit-inner-spin-button{-webkit-appearance: none;}
form.cart button{margin-right:20px;}
form.cart .quantity{display:-webkit-box;display:-ms-flexbox;display: flex !important;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin: 0 !important;box-shadow: none !important;}
form.cart .quantity input{width: 50px !important;min-height: 50px !important;max-height: 50px !important;border-radius: 0 !important;-webkit-box-shadow: none !important;box-shadow: none !important;border: none !important;text-align: center !important;color: #505050 !important;background-color: #FFF !important;font-weight: 500 !important;padding: 0 !important;margin: 0 !important;border-top: 1px solid #e6e6e6 !important;border-bottom: 1px solid #e6e6e6 !important;}
form.cart .minus,
form.cart .plus{width: 50px !important;min-height: 50px !important;max-height: 50px !important;border-radius: 4px !important;-webkit-box-shadow: none !important;box-shadow: none !important;border: 1px solid #e6e6e6 !important;text-align: center !important;color: #000000 !important;font-weight: 500 !important;padding: 0 !important;margin: 0 !important;background-color: #fff;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content:center; -webkit-box-align: center;-ms-flex-align: center;align-items: center;}
form.cart .minus {
border-right: none !important;
border-radius: 0px 0px 0px 0px !important;
}
form.cart .plus {
position: relative;
right: 60px !important;
border-left: unset !important;
border-radius: 0px 0px 0px 0px !important;
margin-right: 20px !important;
}
.product{overflow:inherit !important;}
.info-card{display:-webkit-box;display:-ms-flexbox;display:flex; -webkit-box-align:center; -ms-flex-align:center; align-items:center; -webkit-box-pack:center; -ms-flex-pack:center; !important;justify-content:start; border:1px solid #EFEFEF; padding:10px 10px 0px 10px; margin-bottom: 10px;}
.info-card span[data-tooltip]{left:5px; margin:0 10px; -webkit-transform:translate(-20%, -50%); -ms-transform:translate(-20%, -50%); transform:translate(-20%, -50%)}
button:focus {
outline: unset !important;
}
button.single_add_to_cart_button.button.alt.jupite rx-icon-shopping-cart-6 {
border-radius: 0px !important;
border-color: #ff415a;
}
[data-tooltip] {
position: relative;
z-index: 2;
cursor: pointer;
}
[data-tooltip]:before,
[data-tooltip]:after {
visibility: hidden;
-ms-filter: "progid
XImageTransform.Microsoft.Alpha(Opacity=0 )";filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
pointer-events: none;
}
[data-tooltip]:before {
position: absolute;
bottom: 150%;
left: 50%;
margin-bottom: 5px;
margin-left: -80px;
padding: 7px;
width: 160px;
border-radius: 3px;
background-color: #000;
background-color: hsla(0, 0%, 20%, 0.9);
color: #fff;
content: attr(data-tooltip);
text-align: center;
font-size: 16px;
line-height: 1.2;
}
[data-tooltip]:after {
position: absolute;
bottom: 150%;
left: 50%;
margin-left: -5px;
width: 0;
border-top: 5px solid #000;
border-top: 5px solid hsla(0, 0%, 20%, 0.9);
border-right: 5px solid transparent;
border-left: 5px solid transparent;
content: " ";
font-size: 0;
line-height: 0;
}
[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
visibility: visible;
-ms-filter: "progid
XImageTransform.Microsoft.Alpha(Opacity=1 00)";filter: progid: DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1;
}
.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price::before {
content: attr(data-content) '%';
position: absolute;
left: 0;
height: 58px;
color: #fff;
background: #ff415a;
border-radius: 10px;
line-height: 58px;
font-size: 18px;
width: 58px;
text-align: center;
margin: AUTO;
top: 11px;
font-weight: bold;
}
.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price {
padding-left: 65px;
}
.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price.removed::before {
display: none !important;
}
.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price.removed{
padding: 0 !important;
}
.elementor-125 .elementor-element.elementor-element-cd74a4a .jet-woo-builder .single_add_to_cart_button.button {
height: 50px;
width: 185px;
}
</style>
<?php
}
add_action('wp_head', 'woo_elements_set_style');
add_action( 'woocommerce_after_add_to_cart_quantity', 'display_quantity_plus' );
function display_quantity_plus() {
echo '<button type="button" class="plus" >+</button>';
}
add_action( 'woocommerce_before_add_to_cart_quantity', 'display_quantity_minus' );
function display_quantity_minus() {
echo '<button type="button" class="minus" >-</button>';
}
function turkcetarih_formati($format, $datetime = 'now'){
$z = date("$format", strtotime($datetime));
$gun_dizi = array(
'Monday' => 'Pazartesi',
'Tuesday' => 'Salı',
'Wednesday' => 'Çarşamba',
'Thursday' => 'Perşembe',
'Friday' => 'Cuma',
'Saturday' => 'Cumartesi',
'Sunday' => 'Pazar',
'January' => 'Ocak',
'February' => 'Şubat',
'March' => 'Mart',
'April' => 'Nisan',
'May' => 'Mayıs',
'June' => 'Haziran',
'July' => 'Temmuz',
'August' => 'Ağustos',
'September' => 'Eylül',
'October' => 'Ekim',
'November' => 'Kasım',
'December' => 'Aralık',
'Mon' => 'Pts',
'Tue' => 'Sal',
'Wed' => 'Çar',
'Thu' => 'Per',
'Fri' => 'Cum',
'Sat' => 'Cts',
'Sun' => 'Paz',
'Jan' => 'Oca',
'Feb' => 'Şub',
'Mar' => 'Mar',
'Apr' => 'Nis',
'Jun' => 'Haz',
'Jul' => 'Tem',
'Aug' => 'Au',
'Sep' => 'Eyl',
'Oct' => 'Eki',
'Nov' => 'Kas',
'Dec' => 'Ara',
);
foreach($gun_dizi as $en => $tr){
$z = str_replace($en, $tr, $z);
}
if(strpos($z, 'Mayıs') !== false && strpos($format, 'F') === false) $z = str_replace('Mayıs', 'May', $z);
return $z;
}
// woocommerce_after_single_variation
// Product Functions //
add_action( 'woocommerce_after_add_to_cart_form', 'gk_woo_elements_woocommerce', 10, 0 );
function gk_woo_elements_woocommerce() {?>
<?php date_default_timezone_set('Europe/Istanbul'); ?>
<script type="text/javascript">
const calculateDiscount = (listPrice, salePrice) => {
listPrice = parseFloat(listPrice.slice(0,-2));
salePrice = parseFloat(salePrice.slice(0,-2));
return parseInt(100 - (salePrice * 100 / listPrice)); // Discount percentage
}
jQuery(document).ready(function($){
if ($(".elementor-125 .elementor-element.elementor-element-cd74a4a .elementor-jet-single-add-to-cart .cart .quantity").hasClass("hidden")) {
$("form.cart .minus, form.cart .plus").hide();
}
if($('.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price del span.woocommerce-Price-amount.amount').length > 0){
$('.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price').attr('data-content', calculateDiscount($('.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price del span.woocommerce-Price-amount.amount').text(), $('.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price ins span.woocommerce-Price-amount.amount').text()))
}else{
$('.elementor-125 .elementor-element.elementor-element-b84f7b1 .jet-woo-builder.elementor-jet-single-price .price').addClass('removed');
}
var elements = document.getElementsByClassName('single_add_to_car t_button button alt'); // get all elements
for(var i = 0; i < elements.length; i++){
elements[i].style.backgroundColor = "#ff415a";
elements[i].style.borderRadius = "4px";
}
$('form.cart').on( 'click', 'button.plus, button.minus', function() {
var qty = $( this ).closest( 'form.cart' ).find( '.qty' );
var val = parseFloat(qty.val());
var max = parseFloat(qty.attr( 'max' ));
var min = parseFloat(qty.attr( 'min' ));
var step = parseFloat(qty.attr( 'step' ));
if ( $( this ).is( '.plus' ) ) {
if ( max && ( max <= val ) ) {
qty.val( max );
} else {
qty.val( val + step );
}
} else {
if ( min && ( min >= val ) ) {
qty.val( min );
} else if ( val > 1 ) {
qty.val( val - step );
}
}
});
});
</script>
<br><br>
<div class="info-card" >
<?php
$dayControl = turkcetarih_formati('l');
if (($dayControl == "Cumartesi") || $dayControl == "Pazar") { ?>
<?php
if ($dayControl == "Cumartesi") {
$liveDatecheck = ''.date("F j, Y",strtotime('+2 days')).' '.get_theme_mod('gk_woo_shipping_finish_time').':0 0';
$shipstatus = "Pazartesi";
// Moto kurye //
$moto_liveDatecheck = ''.date("F j, Y",strtotime('+2 days')).' '.get_theme_mod('gk_woo_moto_shipping_finish_time' ).':00';
}
if ($dayControl == "Pazar") {
$liveDatecheck = ''.date("F j, Y",strtotime('+1 days')).' '.get_theme_mod('gk_woo_shipping_finish_time').':0 0';
$shipstatus = "Pazartesi";
// Moto kurye //
$moto_liveDatecheck = ''.date("F j, Y",strtotime('+1 days')).' '.get_theme_mod('gk_woo_moto_shipping_finish_time' ).':00';
}
?>
<?php } else { ?>
<?php
// Normal kargo hesapla //
$ilksaat = date('H:i:s');
$sonsaat = ''.get_theme_mod('gk_woo_shipping_finish_time').': 00';
$ilksaatstr=strtotime($ilksaat);
$sonsaatstr=strtotime($sonsaat);
$fark=$sonsaatstr-$ilksaatstr;
if ($fark < 0) {
// Bugün zaman geçti
$liveDatecheck = ''.date("F j, Y",strtotime('+1 days')).' '.get_theme_mod('gk_woo_shipping_finish_time').':0 0';
$shipstatus = "yarn";
} else {
// daha zaman var
$liveDatecheck = ''.date("F j, Y").' '.get_theme_mod('gk_woo_shipping_finish_time').':0 0';
$shipstatus = "bugün";
}
// Normal kargo hesapla //
?>
<?php } ?>
<?php
// Moto Kurye hesapla //
$ilksaat = date('H:i:s');
$sonsaat = ''.get_theme_mod('gk_woo_moto_shipping_finish_time ').':00';
$ilksaatstr=strtotime($ilksaat);
$sonsaatstr=strtotime($sonsaat);
$farks=$sonsaatstr-$ilksaatstr;
if ($dayControl == "Cumartesi") {
$controlGun = "Hafta Sonu";
} else if ($dayControl == "Pazar") {
$controlGun = "Hafta Sonu";
} else {
$controlGun = "Hafta İçi";
}
if ($controlGun == "Hafta Sonu") {
if ($dayControl == "Cumartesi") {
$shipstatus2 = "İstanbul’da kurye ile siparişinizi. <strong>Bugün</strong> teslim edeceğiz.";
}
if ($dayControl == "Pazar") {
$shipstatus2 = "İstanbul’da kurye ile siparişinizi <strong>Pazartesi</strong> teslim edeceğiz";
}
} else {
if ($farks < 0) {
// Bugün zaman geti
$shipstatus2 = "İstanbul’da kurye ile siparişinizi <strong>yarın</strong> teslim edeceğiz";
} else {
// daha zaman var
$shipstatus2 = "İstanbul’da kurye ile siparişinizi <strong>bugün</strong> teslim edeceğiz";
}
}
// Moto Kurye hesapla //
?>
<img src="https://popilero.com/wp-content/themes/jupiterx/lib/assets/type5.png" style="width: 25px;margin-right: 34px;margin-bottom: 5px;" alt="">
<p id="ship_info_1">
<span id="timer-gunler"></span>
<span id="timer-saatler"></span>
<span id="timer-dakikalar"></span>
<span id="timer-saniyeler"></span>
</p>
</div>
<div class="info-card" style=" justify-content: flex-start !important; ">
<img src="https://popilero.com/wp-content/themes/jupiterx/lib/assets/type1.png" style="width: 30px;margin-right: 34px;margin-bottom: 5px;" alt="">
<p><?php echo $shipstatus2; ?></p>
<span data-tooltip="Kuryenin dağıtm bölgesi dışında bulunan ilçelere Yurtiçi Kargo ile gönderim yapılacaktır."><img src="<?php echo plugin_dir_url( __FILE__ ).'images/tootip-icon.png'; ?>"></span>
</div>
<script type="text/javascript">
window.addEventListener('load', function() {
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
var endDate = new Date("<?php echo $liveDatecheck; ?>").getTime();
let now = new Date().getTime();
let t = endDate - now;
let gunler = Math.floor(t / (1000 * 60 * 60 * 24));
let saatler = Math.floor((t % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let dakikalar = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60));
if (gunler > 0) {
let timerGunler = $("span#timer-gunler");
timerGunler.html("<span class='label'><strong>"+gunler+"</strong> gün</span>");
}
let timerSaatler = $("span#timer-saatler");
timerSaatler.html("<span class='label'><strong>"+("0" + saatler).slice(-2)+"</strong> saat</span>");
let timerDakikalar = $("span#timer-dakikalar");
timerDakikalar.html( "<span class='label'><strong>"+("0" + dakikalar).slice(-2)+"</strong> dakika</span> içerisinde sipariş verirseniz <strong><?php echo $shipstatus; ?></strong> kargoda!</strong>");
} else {
var endDate = new Date("<?php echo $liveDatecheck; ?>").getTime();
window.setInterval(function() {
let now = new Date().getTime();
let t = endDate - now;
if (t >= 0) {
let gunler = Math.floor(t / (1000 * 60 * 60 * 24));
let saatler = Math.floor((t % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let dakikalar = Math.floor((t % (1000 * 60 * 60)) / (1000 * 60));
if (gunler > 0) {
let timerGunler = $("span#timer-gunler");
timerGunler.html( "<span class='label'><strong>"+gunler+"</strong> gün</span>");
}
let timerSaatler = $("span#timer-saatler");
timerSaatler.html("<span class='label'><strong>"+("0" + saatler).slice(-2)+"</strong> saat</span>");
let timerDakikalar = $("span#timer-dakikalar");
timerDakikalar.html( "<span class='label'><strong>"+("0" + dakikalar).slice(-2)+"</strong> dakika</span> içerisinde sipariş verirseniz <strong><?php echo $shipstatus; ?></strong> kargoda!</strong>");
}
else {
document.getElementById("ship_info_1").style.displ ay = "none";
document.getElementById("ship_info_2").style.displ ay = "block";
}
}, 1000);
}
})
</script>
<?php }
[/PHPR]