/**
* Mindestbestellwert festlegen
*/
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 5;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'Ihr aktueller Bestellwert liegt bei %s — Sie müssen eine Bestellung mit einem Mindestwert von %s aufgeben' ,
wc_price( WC()->cart->total ),
wc_price( $minimum )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'Ihr aktueller Bestellwert liegt bei %s — Sie müssen eine Bestellung mit einem Mindestwert von %s aufgeben' ,
wc_price( WC()->cart->total ),
wc_price( $minimum )
), 'error'
);
}
}
}