Warning: include_once(/home/favoledo/robertozanardo.com/wp-content/sunrise.php): Failed to open stream: No such file or directory in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52

Warning: include_once(): Failed opening '/home/favoledo/robertozanardo.com/wp-content/sunrise.php' for inclusion (include_path='.:/opt/alt/php83/usr/share/pear:/opt/alt/php83/usr/share/php:/usr/share/pear:/usr/share/php') in /home/favoledo/robertozanardo.com/wp-includes/ms-settings.php on line 52
Impostare ordine minimo woocommerce - Odoo e Soluzioni Open Source

Impostare ordine minimo woocommerce

E’ possibile aggiungere una funzione apposita (senza necessità di installare plugin aggiuntivi) direttamente nel file functions.php del tema correntemente in uso.

E’ sempre consigliabile utilizzare un tema figlio per mantenere la modifica anche in caso di aggiornamento del tema.

Questo file di base si trova in root\wp-content\themes\nomedeltema\functions.php

E’ sufficiente aggiungere le funzioni in fondo al file:

add_action( 'woocommerce_checkout_process', 'blogwp_minimum_order' );
add_action( 'woocommerce_before_cart' , 'blogwp_minimum_order' );

function blogwp_minimum_order() {
    // Inseriamo il minimo ordine all'interno di una variabile, senza indicare la valuta
    $minimum = 8;
    if ( WC()->cart->total < $minimum ) { 
       if( is_cart() ) { 
           wc_print_notice(sprintf( 'È richiesto un ordine minimo di %s per concludere questo ordine. Il totale del tuo ordine attualmente è %s.', wc_price( $minimum ), wc_price( WC()->cart->total )), 'error');
           }
           else {
           wc_add_notice(sprintf( 'È richiesto un ordine minimo di %s per concludere questo ordine. Il totale del tuo ordine attualmente è %s.' ,wc_price( $minimum ),wc_price( WC()->cart->total )), 'error');
           } // chiusura else      
       } // chiusura del primo if  
    } // chiusura della funzione
add_action ('woocommerce_before_checkout_form', 'blogwp_minimum_order');

In questo caso abbiamo impostato un limite minimo per l’ordine di 8 €.

 

Questo articolo è stato tradotto e adattato dal seguente:

https://docs.woocommerce.com/document/minimum-order-amount/

Lascia un commento

betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betpark
betgaranti
betpark
betgaranti
betpark
betgaranti
Kolaybet
kolaybet
betpark
betpark
betpark
betnano
betnano
betpark
betpark
betpark
betpark
marsbahis
marsbahis
betpark
betpark
betpark
betpark
betpark
kolaybet
sahabet
onwin
onwin
kolaybet
Kolaybet
onwin
onwin
sahabet
sahabet
sahabet
onwin
onwin
sahabet
sahabet
betpark
kolaybet giriş
Katla
Katlabet
nitrobahis
katlabet
kolaybet
kolaybet
hellocasino
hellocasino
betgaranti
Kolaybet
kolaybet
Candycasino
Candycasino
grandpashabet
grandpashabet
grandpashabet
sahabet
sahabet
sahabet
sahabet
onwin
bettilt
bettilt
onwin
sahabet
sahabet
sahabet
sahabet
holiganbet