woocommerce/assets/js/frontend/woocommerce.js

17 lines
427 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 && min > 0 && parseFloat( $( this ).val() ) < min ) {
$( this ).val( min );
}
});
});