我开发了自定义支付网关,它将通过ajax延迟处理支付。我想展示目前在 woocommerce 中使用的相同微调器。
这是我的 jQuery 代码的摘录:
function callAjax(){
jQuery.ajax({
type : "POST",
url: '<?php echo site_url().'/?wc-api=custom_ function'; ?>',
data: response,
//data: {action:'gateway'},
dataType : "json",
cache: false,
success: function(response) {
//alert("Your vote could not be added");
//alert(response);
flag = true;
// window.location = response.redirect;
//console.log(response);
return false;
}
});
}
setTimeout(
function(){ callAjax();
}, 3000);
Run Code Online (Sandbox Code Playgroud)
所以我想做这个:
如何在结帐页面中启动和停止 ajax Woocommerce 叠加旋转器?