-
I’m uisng Events Tickets Plus with Woocommerce.
My client (who’s site I’m building using your theme) sells some products only in pairs.
Woocommerce have a popular plugin that allows products to be purchased in groups or set a min or max quanity allowed.
https://woocommerce.com/products/minmax-quantities/When I set this data using the plugin, I can see in the ticket form source that the min, max and step is set correctly to the data set in the product, but there’s some javascript in the theme assets folder, which sets the qty in the ticketform step to 1 only, so the plugin value is being ignored. It starts on the correct number, but clicking + or – just adds / subtracts 1.
In /ticketbox/assets/js/script.js, line 1948:
$('.quantity').on('click', '.qty-increase', function(e) { var $input = $(this).closest('.quantity').find('input.qty'); var $val = parseInt($input.val()); $input.val( $val + 1 ).change(); }); $('.quantity').on('click', '.qty-decrease', function(e) { var $input = $(this).closest('.quantity').find('input.qty'); var $val = parseInt($input.val()); var $min = $($input).attr('min'); $min = ( $min == 0 ) ? 1 : $min; console.log($min); if( $val > $min){ $input.val( $val - 1 ).change(); } });
As you can see, this only sets the step as 1, how can I force it to take into account the qty limits set by the Woocommerce plugin?
Also, I found that once a user sets 1 quantity, they can’t actually undo that (it locks at 1) so if they select qty 1 in wrong box, they can’t undo it.
I think it’s from this line in above code block:$min = ( $min == 0 ) ? 1 : $min; console.log($min);
Incompatability with Woocommerce Min/Max Qty plugin
This topic is: not resolved