Created
February 5, 2016 10:20
-
-
Save mikejolley/a0a53fdae65353f601ae to your computer and use it in GitHub Desktop.
Show free shipping badge for products over 100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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