wen0750
2020-08-18 17:31:46 +08:00
add_action( 'wp_footer', 'woosb_footer_js', 99 );
function woosb_footer_js() {
?>
<script type="text/javascript">
jQuery(document).on('found_variation', function(e, t) {
var $product = jQuery(e['target']).closest('.woosb-product');
if ($product.length) {
var $qty = $product.find('input.qty');
if ($qty.val() == 0) {
$qty.val(1).trigger('change');
}
}
});
jQuery(document).on('reset_data', function(e) {
var $product = jQuery(e['target']).closest('.woosb-product');
if ($product.length) {
$product.find('input.qty').val(0).trigger('change');
}
});
</script>
<?php
}
Working for wordpress woocommerce
////////// ** Project END ** \\\\\\\\\