'; //alert(product_id); $.ajax({ url: ajaxurl, // Since WP 2.8 ajaxurl is always defined and points to admin-ajax.php dataType: 'JSON', data: { 'action':'azob_buy_now', // This is our PHP function below 'sm' : shipping_method, 'pid' : product_id, 'vid' : v_ids, 'vqt' : v_quantities, }, success:function(data) { if(data['status']){ //console.log(data); //alert(JSON.stringify(data)); var sucessicon = ''; $('.azob_buy_button').html(sucessicon); //$("body").append(popup); location.href = "https://wholesalecartbd.com/checkout/"; /* setTimeout(function() { $('.azob_popup_wrapper').hide(); }, 1000); */ //setTimeout(function() { $("#myElem").hide(); }, 1000); //$("body").append(popup); //$('.widget_shopping_cart_content').html(data['mini_cart']); //$()1609 // //	azob_refresh_minicart(); }else{ //console.log(data); alert('failed'); } //	console.log(data); //	alert(JSON.stringify(data)); //	$("body").append(popup); //$(".be_added_to_cart_success").show(); //	$('.azob_purchase_popup').show(); /* if(data['status']){ alert('working'); //	alert(data['msg']); //	$("body").append(popup); //	$(".be_added_to_cart_success").show(); }else{ //	alert(data['msg']); //	$("body").append(popup); //	$(".be_added_to_cart_failed").show(); //	$(".be_added_to_cart_failed_msg").text(data['msg']); } // This outputs the result of the ajax request (The Callback) //$("body").append(popup); //	$(".be_announce") //	$(".be_add_to_cart").html(data); */ }, error: function(errorThrown){ //window.alert(errorThrown); } }); }else{ var tquantity = 0; $('.vt_quantity').each(function(){ tquantity += parseInt(this.value); }); var tprice = 0; $('.vt_quantity').each(function(){ var pid= $(this).attr('id'); var pprice= $(this).data('price'); var pquantity= parseInt(this.value); if(pquantity>0){ tprice= tprice + pquantity*pprice; } }); /* if(tquantity < minquantity){ alert('Min Order Quatity: '+minquantity); }else if(tprice < minamount){ alert('Min Order Amount: Tk'+minamount); }else{ alert('Something went wrong! Try Later.'); } */ var warning_popup = '