单击后 Woocommerce 下订单按钮状态
Woocommerce place order button state once clicked
当在我的 woocommerce 网站上点击下订单按钮时,需要几秒钟才能完成订单,但是用户看不到显示脚本的滚轮是 运行,因为这是在页面顶部。有没有办法在单击后将按钮上的文本更改为 'Please Wait' 或者至少在访问后更改颜色。
我尝试使用以下 css 更改访问状态的颜色,但它不起作用
.woocommerce #respond input#submit, .woocommerce a.button:visited, .woocommerce button.button:visited, .woocommerce input.button:visited {
color: #ffffff;
background-color: #262a2b;
border-radius: 0px;
}
使用这个:
add_action( 'wp_footer', 'custom_checkout_jquery_script' );
function custom_checkout_jquery_script() {
if ( is_checkout() && ! is_wc_endpoint_url() ) :
?>
<script type="text/javascript">
jQuery( function($){
jQuery('form.checkout').on('submit', function(event) {
jQuery('button#place_order').text('Please Wait');
event.preventDefault();
});
});
</script>
<?php
endif;
}
当在我的 woocommerce 网站上点击下订单按钮时,需要几秒钟才能完成订单,但是用户看不到显示脚本的滚轮是 运行,因为这是在页面顶部。有没有办法在单击后将按钮上的文本更改为 'Please Wait' 或者至少在访问后更改颜色。
我尝试使用以下 css 更改访问状态的颜色,但它不起作用
.woocommerce #respond input#submit, .woocommerce a.button:visited, .woocommerce button.button:visited, .woocommerce input.button:visited {
color: #ffffff;
background-color: #262a2b;
border-radius: 0px;
}
使用这个:
add_action( 'wp_footer', 'custom_checkout_jquery_script' );
function custom_checkout_jquery_script() {
if ( is_checkout() && ! is_wc_endpoint_url() ) :
?>
<script type="text/javascript">
jQuery( function($){
jQuery('form.checkout').on('submit', function(event) {
jQuery('button#place_order').text('Please Wait');
event.preventDefault();
});
});
</script>
<?php
endif;
}