@tipomarwan, it’s a different logic.
So it’s impossible todo?
No way?
🙁
@tipomarwan I’ve a question,
if the available qty is less than the min buy qty, customer should be able to buy the available quantity / it should throw notification that stock is less than the min buy qty ?
Hi
thanks for question
i’ve resolved by this workaround
i’ve set a flag in product page ($mminEnable == ‘yes’) to allow minimun quantity to 5 for selected product
then added this code to functions.php
/*
* Changing the minimum quantity to 5 for all backordered WooCommerce products
*/
function woocommerce_quantity_input_min_callback( $min, $product ) {
global $post;
$mminEnable = get_post_meta( $post->ID, ‘is_minqty5’, true );
if ( $product->managing_stock() && $product->is_on_backorder( 1 ) && $mminEnable == ‘yes’){
$min = 5;
}
return $min;
}
add_filter( ‘woocommerce_quantity_input_min’, ‘woocommerce_quantity_input_min_callback’, 10, 2 );