Hi,
Thanks for your response.
I specified in Unit Price “0,10” and added this code into my theme’s functions file :
add_filter( 'upw_skip_args_validation', '__return_true' );
add_filter( 'upw_product_min_value', 'upw_set_min_value' );
add_filter( 'upw_variation_min_qty', 'upw_set_min_value' );
add_filter( 'woocommerce_update_cart_validation', 'upw_apply_min_quantity', 10, 4 );
function upw_set_min_value( $step ) {
$min_values = [
'0.10' => '0.50',
'0.10' => '0.50',
];
return isset( $min_values[ $step ] ) ? $min_values[ $step ] : $step;
}
function upw_apply_min_quantity( $passed, $cart_item_key, $values, $quantity ) {
$min_values = [
'0.10' => '0.50',
'0.10' => '0.50',
];
$step = $values['data']->get_meta( '_upw_step' );
if ( $step && isset( $min_values[ $step ] ) && $quantity < $min_values[ $step ] ) {
wc_add_notice( __( 'A minimum order amount', 'woocommerce' ) . ' (' . $values['data']->get_name() . '): ' . $min_values[ $step ], 'error' );
return false;
}
return $passed;
}
Unfortunately it does not work correctly, I’m sure I’m missing something ! Can you please help ?
Best regards,