Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Woocommerce 自動更新購物車方法
<?php
//functions.php
add_action( 'woocommerce_after_cart', 'mxp_auto_cart_update_qty_script' );
function mxp_auto_cart_update_qty_script() {
?>
<script>
jQuery('div.woocommerce').on('change', '.qty', function(){
jQuery("[name='update_cart']").removeAttr('disabled');
jQuery("[name='update_cart']").trigger("click");
});
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.