works already. after an hour of doing nothing.. May i know how can i add color to the text
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’ );