Skip to content

Instantly share code, notes, and snippets.

@NickGreen
Last active November 2, 2021 16:33
Show Gist options
  • Save NickGreen/abab8e5553a9a3a46c2ac34513b65f88 to your computer and use it in GitHub Desktop.
Save NickGreen/abab8e5553a9a3a46c2ac34513b65f88 to your computer and use it in GitHub Desktop.
Add cart and checkout notices if total less than $25
<?php
add_action( 'woocommerce_before_cart_table', 'free_shipping_notice' );
add_action( 'woocommerce_checkout_before_customer_details', 'free_shipping_notice' );
function free_shipping_notice() {
if ( 25 > WC()->cart->get_total() ) {
echo '<div style="color: #e08e79;">All orders over $25 ship free</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment