Browse Source

Set stock value as max if less than quantity max

master
Sam Black 3 years ago
parent
commit
ff7deb259e
Signed by: samwwwblack GPG Key ID: 0FF0223994EA47D8
  1. 2
      includes/class-wcqu-filters.php

2
includes/class-wcqu-filters.php

@ -207,7 +207,7 @@ class WC_Quantities_and_Units_Filters {
if ( $stock <= 0 and isset( $values['min_oos'] ) and $values['max_oos'] != '' ) {
$args['max_value'] = $values['max_oos'];
}
elseif ( strlen( $stock ) != 0 && $values['max_value'] > $stock ) {
elseif ( strlen( $stock ) != 0 && $values['max_value'] >= $stock ) {
$args['max_value'] = $stock;
}
// Otherwise just check normal max

Loading…
Cancel
Save