• Hi,

    I set a minimal order amount to place an order.

    The code in function.php:

    function theme_minimum_order(){
        global $woocommerce;
    // Modify $minorder to change amount min order value.
    	$minorder = 20;
    	$cart = $woocommerce->cart->subtotal;
        if( $cart < 20 ){
            wc_add_notice( sprintf(__("Sorry, to place an order online, the amount of your cart must be greater than <strong>", "theme") . $minorder . __("</strong>&euro;. <br /><a href= ?%s ?>Back to Shop &rarr;</a><br />", "theme"), get_permalink( woocommerce_get_page_id("shop") )), 'error' );
        }
    }
    

    I use the translation plugin Transposh for French and English (French is the main language).
    The notice appeared in both languages with previous version of Woocommerce.

    With last version 2.6.7, when I place an order in English with a cart amount under 20€, I get this message:

    SyntaxError: JSON.parse: bad escaped character at line 1 column 188 of the JSON data

    But it is still working in French.

    What’s the matter ?
    Any help would be appreciated.
    Regards.

    P.S.: I test it on localhost with PHP7

Viewing 1 replies (of 1 total)
  • Thread Starter Bonaldi

    (@bonaldi)

    Of course, I placed before the code:
    add_action('woocommerce_before_checkout_process','theme_minimum_order');

    • This reply was modified 8 years, 4 months ago by Bonaldi.
Viewing 1 replies (of 1 total)
  • The topic ‘Error’ is closed to new replies.