Last active
August 29, 2015 14:08
-
-
Save rours/637b722debac38037766 to your computer and use it in GitHub Desktop.
WooCommerce Qty Select - Update Cart Total On Select Change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*-----------------------------------------------------------------------------------*/ | |
/* Update cart total on QTY Select change */ | |
/*-----------------------------------------------------------------------------------*/ | |
function cart_select_change_js() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$(".product-quantity .quantity_select select.qty").change(function(){ | |
$("section.entry .woocommerce").append('<div style="display:none" class="blockUI"></div>'); | |
$("section.entry .woocommerce").append('<div style="z-index: 1000; border: medium none; margin: 0px; padding: 0px; width: 100%; height: 100%; top: 0px; left: 0px; background: url("/wp-content/plugins/woocommerce/assets/images/ajax-loader@2x.gif") no-repeat scroll center center / 16px 16px rgb(255, 255, 255); opacity: 0.6; cursor: wait; position: absolute;" class="blockUI blockOverlay"></div>'); | |
$(".actions input.button").click(); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('woocommerce_after_cart', 'cart_select_change_js', 40); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment