Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created February 5, 2016 10:20
Show Gist options
  • Save mikejolley/a0a53fdae65353f601ae to your computer and use it in GitHub Desktop.
Save mikejolley/a0a53fdae65353f601ae to your computer and use it in GitHub Desktop.
Show free shipping badge for products over 100
add_action( 'woocommerce_before_shop_loop_item_title', 'show_free_shipping_badge' );
function show_free_shipping_badge() {
global $post, $product;
if ( $product && $product->get_price() >= 100 ) {
echo '<span class="free-shipping">' . __( 'Free Shipping!'' ) . '</span>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment