Romitet adlı üyeden alıntı:
mesajı görüntüle
PHP Kod Gizlemek
10
●419
- 14-10-2021, 16:16:13Gizlemeye 335. satırın başından başlayıp 351. satırın sonunda bitirirseniz düzgün bir şekilde gizlenir. Eğer bir html kod parçacığının bir kısmını gizlerseniz html tagini başlatıp doğru yerde bitirmemiş olursunuz ve bu da tasarımda bozulmalara yol açar.promocity adlı üyeden alıntı: mesajı görüntüle
<?php /** * Checkout Form * * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @package WooCommerce\Templates * @version 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } do_action( 'woocommerce_before_checkout_form', $checkout ); // If checkout registration is disabled and not logged in, the user cannot checkout. if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) { echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) ); return; } ?> <style type="text/css"> .right_woo{overflow:hidden;border-style: none;box-shadow: 0 2px 30px 0 rgb(181 169 169 / 50%);border-radius: 6px;border: solid 1px #dedcdf;} .right_woo .button.jupiterx-continue-shopping{display: none !important;} .right_woo h2{font-size: 19px; color: #ff415a; font-weight: 500; width: 100%; text-align: right; margin-top: 20px; padding-right: 30px;} .right_woo p{text-align: right; padding-right: 30px; font-weight: 600; color: #1c1c1c; margin-bottom: 0;} .right_woo p.totalamount{font-size: 24px; font-weight: 400;} .right_woo #place_order{background: #ff415a !important; color: white !important; width: max-content; float: right; margin-right: 30px; padding: 11px 45px; border-radius: 5px; font-size: 16px;} .right_woo .middle{background:#F4F7FA;padding:20px;} .right_woo .middle p.totalss{background:#F4F7FA;text-align: left; width: max-content; float: left;} .right_woo .middle strong .woocommerce-Price-amount{color: #1c1c1c; font-size: 20px; font-weight: 400; display: block; float: right;} .right_woo .middle .includes_tax{width: 100%; display: inline-block; text-align: right; font-size: 16px; font-weight: 400; margin-top: 10px;} .right_woo .middle .includes_tax.forFree{font-size: 13px; line-height: 1.5;} .right_woo .middle .includes_tax.forFree span{color:#ff415a;} .cart_totals table.shop_table.shop_table_responsive{display: none !important;} .right_woo .coupon{font-size: 17px;color: #ff415a;font-weight: 500;width: 100%;margin-top: 20px;padding-left: 20px;} .right_woo .coupon input{width: calc(100% - 20px); margin-bottom: 20px;font-size:13px;} .right_woo .coupon .button{width:115px;background: #ff415a !important; color: white !important; width: max-content; float: right; margin-right: 30px; border-radius: 5px; font-size: 16px;position: absolute; margin-left: -108px; border-radius: 0 10px 10px 0 !important; font-size: 14px; height: 43px;} .checkout.woocommerce-checkout .left_col{width:72%;float:left;} .checkout.woocommerce-checkout .right_col{width:28%;float:left;padding-left:20px;} .woocommerce-form-coupon-toggle{display: none !important;} .woocommerce form .form-row label.checkbox, .woocommerce-page form .form-row label.checkbox { display: block; padding: 0 20px; text-align: left; color: #6c7279; font-weight: 400; font-size: 13px; line-height: 1.4; } .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label.woocommerce-form__label-for-checkbox .woocommerce-terms-and-conditions-checkbox-text{display: inline-block; width: 100%; margin-left: 23px; float: left; margin-top: -19px;} .woocommerce-terms-and-conditions-wrapper .woocommerce-form__label.woocommerce-form__label-for-checkbox .required{display: inline-block; float: right;margin-top: -40px;} #customer_details .col-1, #customer_details .col-2{width:100%;padding:0;} .woocommerce-Price-currencySymbol{font-family: sans-serif !important;} .woocommerce-billing-fields i{color: #ff415a; display: inline-block; float: left; width: 50px; font-size: 40px;} .right_header{padding-left:50px;} .right_header h3{color: black; font-weight: 400; font-size: 22px; margin-bottom: 0;} .right_header p{color:#6c7279;} .woocommerce-billing-fields .check_title{padding:30px 20px 10px 20px;border-bottom:1px solid #eeeeee;} .woocommerce-billing-fields__field-wrapper input{font-size: 17px; padding: 14px 15px !important;} .woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper{padding:20px; display: flow-root;} .woocommerce-shipping-fields i{color: #ff415a; display: inline-block; float: left; width: 50px; font-size: 40px;} .woocommerce-shipping-fields .check_title{padding:30px 20px 10px 20px;border-bottom:1px solid #eeeeee;} .woocommerce-shipping-fields__field-wrapper input, .woocommerce-input-wrapper input{font-size: 17px; padding: 14px 15px !important;} .woocommerce-hediye-fields .forms input{padding: 12px 15px !important;} .woocommerce-shipping-fields__field-wrapper{padding:20px;} .woocommerce-hediye-fields i{color: #ff415a; display: inline-block; float: left; width: 50px; font-size: 40px;} .woocommerce-hediye-fields .check_title{padding:30px 20px 10px 20px;border-bottom:1px solid #eeeeee;} .woocommerce-hediye-fields .forms{padding:20px;} .woocommerce-hediye-fields .forms label{display: inline-block; width: 100%; margin-bottom: 10px; margin-top: 0;} .woocommerce-hediye-fields .forms span{float: right; margin-top: -20px; margin-bottom: 10px; font-size: 16px; color: #ff415a;} .woocommerce-hediye-fields .forms span b{font-weight:400;} .woocommerce-hediye-fields .forms textarea{width: 100%; resize: none; height: 100px;} .woocommerce-hediye-fields .forms input{min-width: 300px;} #billing_country_field, #billing_address_2_field, #shipping_address_2_field{display: none !important;} .woocommerce-page .jupiterx-primary form .form-row { width: 50% !important; float: left; clear: none; padding: 10px;} .woocommerce-page .jupiterx-primary .select2-container--default .select2-selection--single .select2-selection__rendered, .woocommerce form .select2-container--default .select2-selection--single .select2-selection__rendered {padding: 1.032rem .7rem} .choice_shipping{} .choice_shipping input[type="date"]{width:100%;} .choice_shipping input[type="radio"]{box-shadow: none !important;width: 15px; display: block; min-width: 10px; margin-top: -48px; margin-left: 30px; margin-bottom: 20px;} .choice_shipping label.radio{border: 1px solid #b8b8b8;border-radius: 5px;} .choice_shipping label .content{border-radius: 5px; padding: 0; width: calc(100% - 60px); float: right;} .choice_shipping label .content img{margin-right:15px;height: 50px;} .choice_shipping label .content span{float: none;margin-top: 0;margin-bottom: 0;color: #6e747b;} .choice_shipping p.infos{padding-left: 14px; font-size: 12px;} .choice_shipping p.date{margin-top: 0; font-size: 16px;} #shipping_address_1_field { opacity: 0; height: 0px !important; } #ship-to-different-address{margin-bottom:0;} #ship-to-different-address label{margin-bottom:0;font-weight: 400; margin-left: 20px;margin-top:20px;} .woocommerce-additional-fields{padding:0 20px;} .woocommerce-additional-fields textarea{width:100% !important;resize:none;} #order_comments_field{width: 100% !important;} .woocommerce-checkout #payment ul.payment_methods{border-bottom:none !important;} table.shop_table.woocommerce-checkout-review-order-table{width:100% !important;} #payment{display: inline-block; width: 100%;border-style: none;box-shadow: 0 2px 30px 0 rgb(181 169 169 / 50%);border-radius: 6px;border: solid 1px #dedcdf;margin-top:20px;} #payment .place-order{display: none !important;} label{font-size: 16px; margin-bottom: 0; color: #6c7279;} label .required{ color: #6c7279;} .woocommerce-terms-and-conditions-wrapper{display: inline-block; width: 100%;} .kargoType{background: white; padding: 5px; border: 1px solid lightgrey; border-radius: 6px;} .kargoType img{width:50px;height:50px;object-fit:contain;} .kargoType span.name{font-size:12px;} .kargoType .priceKargo{float: right; display: block; margin-top: 13px; font-size: 16px; font-weight: 400; color: black;margin-right: 10px;} .kargoType.free .priceKargo{font-size: 15px; margin-right: 3px;} .kargoType .priceKargo .currency{font-family: sans-serif !important;} table.woocommerce-checkout-review-order-table tfoot .woocommerce-shipping-totals.shipping{display: none;} .woocommerce-page .jupiterx-primary form .form-row.w-100 { width: 100% !important; } div#payment { opacity: 0 !important; height: 0 !important; } @media only screen and (max-width: 768px) { .left_col, .right_col{width:100% !important;} .woocommerce-page .jupiterx-primary form .form-row{width: 50% !important;margin-bottom:0;} .choice_shipping input[type="radio"]{margin-left:10px;} .choice_shipping label .content { border-radius: 5px; padding: 10px 4px; width: calc(100% - 36px);} .choice_shipping label .content img{margin-right: 2px;height:40px;} .choice_shipping input[type="date"] { width: 100%; min-width: unset;} .woocommerce-hediye-fields .forms input{min-width: unset;width:100%;} .checkout.woocommerce-checkout .right_col{padding-left:0;margin-top:30px;} .choice_shipping label .content span{font-size:13px;} .woocommerce-terms-and-conditions-wrapper .woocommerce-form__input{margin: 0; float: left;} .woocommerce-page .jupiterx-primary input, .woocommerce-page .jupiterx-primary textarea, .woocommerce-page .jupiterx-primary select, .woocommerce form input, .woocommerce form textarea, .woocommerce form select{width: 100% !important;} .woocommerce form input[type=radio]{width: auto !important;} .woocommerce-shipping-fields__field-wrapper input, .woocommerce-input-wrapper input,span#select2-shipping_state-container { padding: 8px 15px !important; }.woocommerce-billing-fields__field-wrapper, .woocommerce-shipping-fields__field-wrapper { padding: 0 20px 5px 20px; } } </style> <?php // Loop through shipping packages from WC_Session (They can be multiple in some cases) foreach ( WC()->cart->get_shipping_packages() as $package_id => $package ) { // Check if a shipping for the current package exist if ( WC()->session->__isset( 'shipping_for_package_'.$package_id ) ) { // Loop through shipping rates for the current package foreach ( WC()->session->get( 'shipping_for_package_'.$package_id )['rates'] as $shipping_rate_id => $shipping_rate ) { $rate_id = $shipping_rate->get_id(); // same thing that $shipping_rate_id variable (combination of the shipping method and instance ID) $method_id = $shipping_rate->get_method_id(); // The shipping method slug $instance_id = $shipping_rate->get_instance_id(); // The instance ID $label_name = $shipping_rate->get_label(); // The label name of the method $cost = floatval($shipping_rate->get_cost()); // The cost without tax $tax_cost = $shipping_rate->get_shipping_tax(); // The tax cost $taxes = $shipping_rate->get_taxes(); // The taxes details (array) } } } ?> <form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data"> <div class="left_col"> <?php if ( $checkout->get_checkout_fields() ) : ?> <?php do_action( 'woocommerce_checkout_before_customer_details' ); ?> <div class="col2-set" id="customer_details"> <div class="col-2"> <?php do_action( 'woocommerce_checkout_shipping' ); ?> </div> <div class="col-1"> <?php do_action( 'woocommerce_checkout_billing' ); ?> </div> <div class="col-1"> <div class="woocommerce-hediye-fields"> <div class="check_title"> <i class="fas fa-map-marker-alt"></i> <div class="right_header"> <h3>Gönderim Seçenekleri</h3> <p>Gönderim detayları</p> </div> </div> <?php $shipping_state = WC()->customer->get_shipping_state(); ?> <div class="forms choice_shipping"> <div class="row"> <?php $totalim = $cart = WC()->cart->subtotal; foreach (WC()->shipping->get_shipping_methods() as $key => $value){ if ($key==13) { $minvalue = $value->min_amount; }elseif($key==14){ $minvalue = $value->min_amount; } } if ($cost > 0) { ?> <div class="col-md-6"><label>Gönderim Yöntemi</label> <div id="kuryeChange2"> <label class="radio" for="upskargo"> <div class="content"> <img src="/wp-content/themes/jupiterx/lib/assets/yurtici-kargo.png"> <span>YURTİÇİ KARGO</span> </div> </label> <input type="radio" name="ship_type" id="upskargo" onchange="setShip(1)"> <p class="infos">YURTİÇİ Kargo ile hızlı ve güvenilir teslimat</p> </div> <div id="kuryeChange"> <label class="radio" for="type2" > <div class="content"> <img src="/wp-content/themes/jupiterx/lib/assets/type1.png"> <span>ÖZEL MOTO KURYE</span> </div> </label> <input type="radio" name="ship_type" id="type2" onchange="setShip(2)"> <p class="infos">İstanbul içi özel kurye ile gün içerisinde teslimat</p> </div> </div> <?php }else{ ?> <div class="col-md-6"><label>Gönderim Yöntemi</label> <div id="kuryeChange2"> <label class="radio" for="type3"> <div class="content"> <img src="/wp-content/themes/jupiterx/lib/assets/yurtici-kargo.png"> <span>ÜCRETSİZ KARGO</span> </div> </label> <input type="radio" name="ship_type" id="type3" onchange="setShip(3)" checked> <p class="infos">Kargonuz ücretsiz olarak gönderilecektir.</p> </div> <div id="kuryeChange"> <label class="radio" for="type4" > <div class="content"> <img src="/wp-content/themes/jupiterx/lib/assets/type1.png"> <span>ÖZEL MOTO KURYE</span> </div> </label> <input type="radio" name="ship_type" id="type4" onchange="setShip(4)"> <p class="infos">İstanbul içi özel kurye ile gün içerisinde teslimat</p> </div> </div> <?php } ?> <div class="col-md-6"> <label>Gönderim Tarihini Belirleyiniz</label> <input onchange="changeDateFunc(this.value)" type="date" name="order_val_shipping_set_date" id="order_val_shipping_set_date" value="<?php echo date('Y-m-d'); ?>" min="<?php echo date('Y-m-d'); ?>"> <p class="infos">Kargonuzu zamanlayabilirsiniz.</p> </div> <div class="col-md-12"> <p class="date">Siparişiniz <b id="changeDate"><?php echo date('d.m.Y'); ?></b> tarihinde kargoya verilecektir.</p> </div> </div> </div> <script type="text/javascript"> function setShip(number){ var beforePrice = parseFloat(jQuery('.right_woo .top .totalamount .woocommerce-Price-amount bdi').text()); if (number==1) { jQuery("#shipping_method_0_flat_rate10").prop("checked", true); jQuery('#kargo1').show(); jQuery('#kargo2').hide(); var willAddPrice = parseFloat(jQuery('#kargo1 .priceKargo .priceKargoTl').text()); $.ajax({ type: 'POST', url: '<?php echo get_bloginfo('template_directory'); ?>/lib/templates/woocommerce/checkout/motokurye-ajax.php', data: {'type': 'defaultship'}, success: function(ajaxCevap) { $('body').trigger('update_checkout'); } }); }else if(number==2){ jQuery("#shipping_method_0_flat_rate11").prop("checked", true); jQuery('#kargo2').show(); jQuery('#kargo1').hide(); var willAddPrice = parseFloat(jQuery('#kargo2 .priceKargo .priceKargoTl').text()); $.ajax({ type: 'POST', url: '<?php echo get_bloginfo('template_directory'); ?>/lib/templates/woocommerce/checkout/motokurye-ajax.php', data: {'type': 'motokurye'}, success: function(ajaxCevap) { $('body').trigger('update_checkout'); } }); }else if(number==3){ jQuery("#shipping_method_0_flat_rate11").prop("checked", true); jQuery('#kargo3').show(); jQuery('#kargo4').hide(); var willAddPrice = parseFloat(jQuery('#kargo3 .priceKargo .priceKargoTl').text()); $.ajax({ type: 'POST', url: '<?php echo get_bloginfo('template_directory'); ?>/lib/templates/woocommerce/checkout/motokurye-ajax.php', data: {'type': 'freeship'}, success: function(ajaxCevap) { $('body').trigger('update_checkout'); } }); }else if(number==4){ jQuery("#shipping_method_0_flat_rate11").prop("checked", true); jQuery('#kargo4').show(); jQuery('#kargo3').hide(); var willAddPrice = parseFloat(jQuery('#kargo4 .priceKargo .priceKargoTl').text()); $.ajax({ type: 'POST', url: '<?php echo get_bloginfo('template_directory'); ?>/lib/templates/woocommerce/checkout/motokurye-ajax.php', data: {'type': 'motokurye'}, success: function(ajaxCevap) { $('body').trigger('update_checkout'); } }); } var lastPrice = beforePrice + willAddPrice; lastPrice = lastPrice.toFixed(2); var lastWillAdd = '<bdi>'+lastPrice+' <span class="woocommerce-Price-currencySymbol">₺</span></bdi>'; jQuery('#latestTotal .woocommerce-Price-amount ').html(lastPrice+' <span class="woocommerce-Price-currencySymbol"></span>'); jQuery('body').trigger('update_checkout'); } </script> </div> </div> <div class="col-1"> <!--<div class="woocommerce-hediye-fields"> <div class="check_title"> <i class="fas fa-map-marker-alt"></i> <div class="right_header"> <h3>Hediye Notunuz</h3> <p>Hediye kutusu için not.</p> </div> </div> <div class="forms"> <label>Notunuz</label> <span id="count_not"><b id="valueentered">0</b>/300</span> <textarea name="order_val_gift_text" id="order_val_gift_text" placeholder="Hediye notunuzu bu alana yazabilirsiniz. "></textarea> </div> </div>--> </div> </div> <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?> <?php endif; ?> <?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?> <!--<h3 id="order_review_heading"><?php esc_html_e( 'Your order', 'woocommerce' ); ?></h3>--> <?php do_action( 'woocommerce_checkout_before_order_review' ); ?> <div id="order_review" class="woocommerce-checkout-review-order"> <?php do_action( 'woocommerce_checkout_order_review' ); ?> </div> </div> <div class="right_col"> <?php if (wp_is_mobile()) { ?> <div class="right_woo "> <?php }else{ ?> <div class="right_woo stickthis"> <?php } ?> <div class="top"> <h2>Sepet Tutarı</h2> <p>Ara Toplam</p> <p class="totalamount"><?php wc_cart_totals_subtotal_html(); ?></p> <div class="wc-proceed-to-checkout"> <?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="Ödemeye Geç" data-value="demeye Geç">Ödemeye Geç</button>' ); // @codingStandardsIgnoreLine ?> </div> <?php if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) ) { do_action( 'woocommerce_checkout_before_terms_and_conditions' ); ?> <div class="woocommerce-terms-and-conditions-wrapper"> <?php /** * Terms and conditions hook used to inject content. * * @since 3.4.0. * @hooked wc_checkout_privacy_policy_text() Shows custom privacy policy text. Priority 20. * @hooked wc_terms_and_conditions_page_content() Shows t&c page content. Priority 30. */ ?> <?php if ( wc_terms_and_conditions_checkbox_enabled() ) : ?> <p class="form-row validate-required"> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> <input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); // WPCS: input var ok, csrf ok. ?> id="terms" /> <span style="width: 210px;" class="woocommerce-terms-and-conditions-checkbox-text"><?php wc_terms_and_conditions_checkbox_text(); ?></span> <span class="required">*</span> </label> <input type="hidden" name="terms-field" value="1" /> </p> <?php endif; ?> </div> <?php do_action( 'woocommerce_checkout_after_terms_and_conditions' ); } ?> </div> <div class="middle" style="display: inline-block; width: 100%; margin-bottom: -10px;border-bottom:11px solid #eaeaea;"> <tr class="order-total"> <p class="totalss" style="float:none;">Gönderim</p> <?php $totalim = $cart = WC()->cart->subtotal; foreach (WC()->shipping->get_shipping_methods() as $key => $value){ if ($shipping_state=='TR34') { if($key==14){ $minvalue = $value->min_amount; } }else{ if ($key==13) { $minvalue = $value->min_amount; } } } if ($cost > 0) { ?> <div class="kargoType" id="kargo1"> <img src="/wp-content/themes/jupiterx/lib/assets/yurtici-kargo.png"> <span class="name">YURTİÇİ KARGO</span> <span class="priceKargo" id="upsPrice"> <span class="priceKargoTl"><?=$cost;?></span> <span class="currency"></span> </span> </div> <div class="kargoType" id="kargo2" style="display:none;"> <img src="/wp-content/themes/jupiterx/lib/assets/type1.png"> <span class="name">MOTOR KURYE</span> <span class="priceKargo" id="upsPrice"> <span class="priceKargoTl"><?=$cost;?></span> <span class="currency">₺</span> </span> </div> <?php }else{ ?> <div class="kargoType free" id="kargo3"> <img src="/wp-content/themes/jupiterx/lib/assets/yurtici-kargo.png"> <span class="name">ÜCRETSİZ KARGO</span> <span class="priceKargo" id="upsPrice"> <span class="priceKargoTl"><?=$cost;?></span> <span class="currency"></span> </span> </div> <div class="kargoType free" id="kargo4" style="display:none;"> <img src="/wp-content/themes/jupiterx/lib/assets/type1.png"> <span class="name">MOTOR KURYE</span> <span class="priceKargo" id="upsPrice"> <span class="priceKargoTl"><?=$cost;?></span> <span class="currency">₺</span> </span> </div> <?php } ?> </tr> </div> <div class="middle" style="display: none; width: 100%; margin-bottom: -10px;border-bottom:11px solid #eaeaea;"> <tr class="order-total"> </tr> </div> <div class="middle" id="latestTotal" style="display: inline-block; width: 100%; margin-bottom: -10px;"> <tr class="order-total"> <p class="totalss">Toplam</p> <td data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php wc_cart_totals_order_total_html(); ?></td> </tr> </div> </div> </div> <?php do_action( 'woocommerce_checkout_after_order_review' ); ?> </form> <?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?> <script type="text/javascript"> jQuery(document).ready(function () { var textStr = jQuery('#shipping_address_new').val(); jQuery('#shipping_address_1').val(textStr); }); jQuery('#shipping_address_new').keypress(function() { var textStr = jQuery(this).val(); jQuery('#shipping_address_1').val(textStr); }); jQuery('#shipping_address_new').on('change',function() { var textStr = jQuery(this).val(); jQuery('#shipping_address_1').val(textStr); }); jQuery('#order_val_gift_text').keypress(function() { var textStr = jQuery(this).val(); var countText = textStr.length; countText++; if (countText>300) { textStr = textStr.slice(0,-1); jQuery(this).val(textStr); countText--; } jQuery('#valueentered').text(countText); }); function changeDateFunc(elem){ var dateim = elem.split('-'); var formatDate = dateim[2]+'.'+dateim[1]+'.'+dateim[0]; jQuery('#changeDate').text(formatDate); jQuery('#changeDate2').text(formatDate); document.getElementById("order_val_gokhan").value = formatDate; } var selectVal2 = jQuery('#shipping_state').val(); if (selectVal2 == 'TR34') { jQuery('#kuryeChange').show(); jQuery('#shipping_method_0_flat_rate11').show(); jQuery("label[for='shipping_method_0_flat_rate11']").show(); }else{ jQuery('#kuryeChange').hide(); jQuery('#shipping_method_0_flat_rate11').hide(); jQuery("label[for='shipping_method_0_flat_rate11']").hide(); } <?php if ($cost > 0) { ?> jQuery(document).ready(function () { var selectVal = jQuery("#shipping_state").val(); if (selectVal == 'TR34') { jQuery('#kuryeChange').show(); jQuery('#kuryeChange2').hide(); jQuery('#shipping_method_0_flat_rate11').show(); jQuery("label[for='shipping_method_0_flat_rate11']").show(); jQuery('#type2').prop('checked',true); setShip(2); }else{ jQuery('#kuryeChange').hide(); jQuery('#kuryeChange2').show(); jQuery('#shipping_method_0_flat_rate11').hide(); jQuery("label[for='shipping_method_0_flat_rate11']").hide(); jQuery('#upskargo').prop('checked',true); setShip(1); } }); jQuery('#shipping_state').on('change', function() { var selectVal = jQuery(this).val(); if (selectVal == 'TR34') { jQuery('#kuryeChange').show(); jQuery('#kuryeChange2').hide(); jQuery('#shipping_method_0_flat_rate11').show(); jQuery("label[for='shipping_method_0_flat_rate11']").show(); jQuery('#type2').prop('checked',true); setShip(2); }else{ jQuery('#kuryeChange').hide(); jQuery('#kuryeChange2').show(); jQuery('#shipping_method_0_flat_rate11').hide(); jQuery("label[for='shipping_method_0_flat_rate11']").hide(); jQuery('#upskargo').prop('checked',true); setShip(1); } }); <?php }else{ ?> jQuery(document).ready(function () { var selectVal = jQuery("#shipping_state").val(); if (selectVal == 'TR34') { jQuery('#kuryeChange').show(); jQuery('#kuryeChange2').hide(); jQuery('#shipping_method_0_flat_rate11').show(); jQuery("label[for='shipping_method_0_flat_rate11']").show(); jQuery('#type4').prop('checked',true); setShip(4); }else{ jQuery('#kuryeChange').hide(); jQuery('#kuryeChange2').show(); jQuery('#shipping_method_0_flat_rate11').hide(); jQuery("label[for='shipping_method_0_flat_rate11']").hide(); jQuery('#type3').prop('checked',true); setShip(3); } }); jQuery('#shipping_state').on('change', function() { var selectVal = jQuery(this).val(); if (selectVal == 'TR34') { jQuery('#kuryeChange').show(); jQuery('#kuryeChange2').hide(); jQuery('#shipping_method_0_flat_rate11').show(); jQuery("label[for='shipping_method_0_flat_rate11']").show(); jQuery('#type4').prop('checked',true); setShip(4); }else{ jQuery('#kuryeChange').hide(); jQuery('#kuryeChange2').show(); jQuery('#shipping_method_0_flat_rate11').hide(); jQuery("label[for='shipping_method_0_flat_rate11']").hide(); jQuery('#type3').prop('checked',true); setShip(3); } }); <?php } ?> var stickitLeft = (jQuery(window).width() - (jQuery('.stickthis').offset().left + jQuery('.stickthis').outerWidth())); var stickitWidth = jQuery('.stickthis').width() + 'px'; var stickitHeight = jQuery('.stickthis').height() + 'px'; var stickySidebarToTop = jQuery('.stickthis').offset().top; var stickySidebarToBottom = jQuery('.stickthis').offset().top + jQuery(window).height(); jQuery(window).scroll(function() { var windowToTop = jQuery(window).scrollTop();var scrollBottom = jQuery(window).scrollTop() + jQuery(window).height(); console.log(windowToTop+' - '+(parseFloat(stickySidebarToBottom) + 140)); if ((windowToTop + 240 > stickySidebarToTop) && (windowToTop < parseFloat(stickySidebarToBottom) + 140)) { jQuery('.stickthis').css({ 'position': 'fixed', 'top': '30px', 'right': stickitLeft, 'width': stickitWidth, 'height': stickitHeight }) } else if(windowToTop > parseFloat(stickySidebarToBottom) + 140){ jQuery('.stickthis').css({ 'position': 'absolute', 'top': parseFloat(stickySidebarToBottom) - 70, 'right': '20px', 'width': stickitWidth, 'height': stickitHeight }) } else { jQuery('.stickthis').removeAttr('style'); } }) </script>