📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv8.demodesign.com.tr
/
javascript
📝
functions.js
← Geri Dön
var oneMoreTime = 1; function to_cart() { var val = $("form#add_to_cart").serialize(); var option_name=$("select[name='option_name']").val(); option_name=jQuery.trim(option_name); var new_price=$("input[name='new_price']").val(); new_price=jQuery.trim(new_price); var number=$("input[name='number']").val(); number=jQuery.trim(number); total_price = (number * new_price); $('#result_spin_a_sepet').stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-times fa-spinner fa-spin"></i>').show(); if( oneMoreTime == 1 ) { oneMoreTime = 0; $.ajax({ url: "functions.php?cr=add_to_cart&t_price=" + total_price , type: "POST", data: val, dataType: "json", success: function (reply) { if (reply.error) { if (option_name == "") { $('html,body').animate({scrollTop: $('.product-detail').offset().top}, 1500, function() { $('#option_name').css({'box-shadow': '0px 0px 0px 1px rgb(255, 0, 0)',}); }); } $("#result_e_reviews_a_sepet").html(reply.error).show().removeClass("e-alert-box-green").addClass("e-alert-box-red"); $('#result_spin_a_sepet').stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-times"></i>').show(); } else if (reply.success) { $("#result_e_reviews_a_sepet").html(reply.success).show().addClass("e-alert-box-green").removeClass("e-alert-box-red"); $('#result_spin_a_sepet').stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-check"></i>').show(); $('#option_name').css({ 'box-shadow': '0px 2px 3px 0px rgba(234, 234, 234, 1)', }); setTimeout(function() { $('html,body').animate({scrollTop: $('.container').offset().top}, 1500, function() { $('.dropdown-box').css({ 'top': '55px', 'opacity': '1', 'visibility': 'visible', '-webkit-transition': 'all 0.3s ease-in-out', '-moz-transition': 'all 0.3s ease-in-out', '-ms-transition': 'all 0.3s ease-in-out', '-o-transition': 'all 0.3s ease-in-out', 'transition': 'all 0.3s ease-in-out', }); }); }, 2000); } oneMoreTime = 1; $.ajax({ url: "functions.php?cr=add_r", type: "POST", data: val, dataType: "json", success: function(reply) { if (reply.yes_cart) { $(".yes_cart").html(reply.yes_cart); $(".suc_count").html(reply.cart_count); $(".suc_count_pi").html(reply.cart_count_pi); $(".no_cart_empty").hide(); $(".yes_cart_empty").show(); } else if (reply.no_cart) { $(".no_cart").html(reply.no_cart); $(".yes_cart_empty").hide(); } } }); } }); } return false; } function to_cart_manual(id) { var val = $("form#add_to_cart_"+id).serialize(); var option_name=$("select[name='option_name']").val(); option_name=jQuery.trim(option_name); var new_price=$("input[name='new_price']").val(); new_price=jQuery.trim(new_price); var number=$("input[name='number']").val(); number=jQuery.trim(number); total_price = (number * new_price); $('#result_spin_a_sepet_'+id).stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-times fa-spinner fa-spin"></i>').show(); if( oneMoreTime == 1 ) { oneMoreTime = 0; $.ajax({ url: "functions.php?cr=add_to_cart&t_price=" + total_price , type: "POST", data: val, dataType: "json", success: function (reply) { if (reply.error) { if (option_name == "") { $('html,body').animate({scrollTop: $('.product-detail').offset().top}, 1500, function() { $('#option_name').css({'box-shadow': '0px 0px 0px 1px rgb(255, 0, 0)',}); }); } $("#result_e_reviews_a_sepet").html(reply.error).show().removeClass("e-alert-box-green").addClass("e-alert-box-red"); $('#result_spin_a_sepet_'+id).stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-times"></i>').show(); } else if (reply.success) { $("#result_e_reviews_a_sepet").html(reply.success).show().addClass("e-alert-box-green").removeClass("e-alert-box-red"); $('#result_spin_a_sepet_'+id).stop().html('<i style="font-size: 22px;float:left;margin-left: 20px;margin-right: -13px;margin-top: 16px;" class="fa fa-check"></i>').show(); $('#option_name').css({ 'box-shadow': '0px 2px 3px 0px rgba(234, 234, 234, 1)', }); setTimeout(function() { $('html,body').animate({scrollTop: $('.container').offset().top}, 1500, function() { $('.dropdown-box').css({ 'top': '55px', 'opacity': '1', 'visibility': 'visible', '-webkit-transition': 'all 0.3s ease-in-out', '-moz-transition': 'all 0.3s ease-in-out', '-ms-transition': 'all 0.3s ease-in-out', '-o-transition': 'all 0.3s ease-in-out', 'transition': 'all 0.3s ease-in-out', }); }); }, 2000); } oneMoreTime = 1; $.ajax({ url: "functions.php?cr=add_r", type: "POST", data: val, dataType: "json", success: function(reply) { if (reply.yes_cart) { $(".yes_cart").html(reply.yes_cart); $(".suc_count").html(reply.cart_count); $(".suc_count_pi").html(reply.cart_count_pi); $(".no_cart_empty").hide(); $(".yes_cart_empty").show(); $(".suc_count").show(); $(".btn-cart").show(); $(".suc_count_pi").show(); } else if (reply.no_cart) { $(".no_cart").html(reply.no_cart); $(".yes_cart_empty").hide(); } } }); } }); } return false; } $('.dropdown-box').hover(function(){ $('.dropdown-box').removeAttr('style'); }) $('.icon-cart').hover(function(){ $('.dropdown-box').removeAttr('style'); }) $(function() { var oks = $( "#option_name option:selected" ).val(); var val = ""; $.ajax({ url: "functions.php?cr=opt&sub_category_search_id="+oks, type: "POST", data: val, dataType: "json", success: function(reply) { if (reply.yes_option) { $(".yes_option").html(reply.yes_option); $(".option").show(); } else if (reply.no_option) { $(".no_option").html(reply.no_option); $(".option").hide(); } } }); }); $("select#option_name").change(function() { var oks = $( "#option_name option:selected" ).val(); var val = ""; $.ajax({ url: "functions.php?cr=opt&sub_category_search_id="+oks, type: "POST", data: val, dataType: "json", success: function(reply) { if (reply.yes_option) { $(".yes_option").html(reply.yes_option); $(".option").show(); } else if (reply.no_option) { $(".no_option").html(reply.no_option); $(".option").hide(); } } }); }); $(".decCountBtn").click(function(){ $.ajax({ url: "functions.php?cr=decount", type: "POST", data: data= { p :"decCount", product_id : $(this).attr("product-id") }, dataType: "json", success: function(reply) { //alert(reply.no_option); window.location.reload(); } }); }); $(".incCountBtn").click(function(){ $.ajax({ url: "functions.php?cr=incCountBtn", type: "POST", data: data= { p :"incCountBtn", product_id : $(this).attr("product-id") }, dataType: "json", success: function(reply) { //alert(reply.no_option); window.location.reload(); } }); }); $(".removeBtn").click(function(){ $.ajax({ url: "functions.php?cr=removeBtn", type: "POST", data: data= { p :"removeBtn", product_id : $(this).attr("product-id") }, dataType: "json", success: function(reply) { //alert(reply.no_option); window.location.reload(); } }); }); function cart(){ var val="s"; $.ajax({ url: "functions.php?cr=add_r", type: "POST", data: val, dataType: "json", success: function(reply) { if (reply.no_cart) { $(".yes_cart").html(reply.no_cart); $(".suc_count").hide(); $(".btn-cart").hide(); $(".suc_count").hide(); $(".suc_count_pi").hide(); } else { $(".yes_cart").html(reply.yes_cart); $(".suc_count").html(reply.cart_count); $(".suc_count_pi").html(reply.cart_count_pi); } } }); } function removeurun(id){ $.ajax({ url: "functions.php?cr=removeBtn", type: "POST", data: data= { p :"removeBtn", product_id : id }, dataType: "json", success: function(reply) { //alert(reply.no_option); cart(); } }); }
💾 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