Skip to content Skip to footer

Mindestbestellwert für Woocommerce

WooCommerce Mindestbestellwert

Vor der Anwendung einer Änderung sollte immer ein Backup durchgeführt werden. 

Dieser Codeschnippsel bestimmt einen Mindestbestellwert in WooCommerce fest.

Diesen gilt es in die functions.php eures Child-Themes zu platzieren und abzuspeichern.

/** WooCommerce – Mindestbestellwert* https://wooexperte.de/snippet/woocommerce-mindestbestellwert/*/add_action( ‚woocommerce_checkout_process‘, ‚wc_minimum_order_amount‘ );add_action( ‚woocommerce_before_cart‘ , ‚wc_minimum_order_amount‘ );function wc_minimum_order_amount() {$minimum = 50; // Hier bitte den Mindestbestellwert eingebenif ( WC()->cart->total < $minimum ) {if( is_cart() ) {wc_print_notice(sprintf( ‚Der Mindestbestellwert beträgt %s pro Bestellung. Der aktuelle Bestellwert beträgt %s.‘ , // Text anpassen Warenkorbwc_price( $minimum ),wc_price( WC()->cart->total )), ‚error‘);} else {wc_add_notice(sprintf( ‚Der Mindestbestellwert beträgt %s pro Bestellung. Der aktuelle Bestellwert beträgt %s.‘ , // Text anpassen Kassewc_price( $minimum ),wc_price( WC()->cart->total )), ‚error‘);}}}