Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter linksocks

    (@linksocks)

    works already. after an hour of doing nothing.. May i know how can i add color to the text

    Thread Starter linksocks

    (@linksocks)

    Hi , I just realized what actually happened. Is doesn’t appear on the Checkout page but only on the View Cart page. Can i add this to both. if so, how?

    Sam

    (@ssharples)

    just add this code to your functions.php file

    // If your free shipping threshold is 1500 as per Woocommerce settings…
    // …show a cart notice if order subtotal is less than 1500
    function cart_notice() {
    $maximum = 1500;
    $current = WC()->cart->subtotal;
    // Format the difference as per Woo currency formatting settings
    $formatteddifference = wc_price( $maximum – $current );
    if ( $current < $maximum ) {
    echo ‘<div class=”woocommerce-message”>Get free shipping if you order ‘ . $formatteddifference . ‘ more!</div>’;
    }
    }
    add_action( ‘woocommerce_before_cart’, ‘cart_notice’ );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘doesnt work’ is closed to new replies.