woocommerce/assets/js/frontend/woocommerce.js

16 lines
420 B
JavaScript

jQuery( function( $ ) {
// Orderby
$( '.woocommerce-ordering' ).on( 'change', 'select.orderby', function() {
$( this ).closest( 'form' ).submit();
});
// Target quantity inputs on product pages
$( 'input.qty:not(.product-quantity input.qty)' ).each( function() {
var min = parseFloat( $( this ).attr( 'min' ) );
if ( min >= 0 && parseFloat( $( this ).val() ) < min ) {
$( this ).val( min );
}
});
});