Skip to content

Instantly share code, notes, and snippets.

@rwkyyy
Created May 18, 2018 12:25
Show Gist options
  • Save rwkyyy/59a9bbe84e667fcadd60c416f6f051c0 to your computer and use it in GitHub Desktop.
Save rwkyyy/59a9bbe84e667fcadd60c416f6f051c0 to your computer and use it in GitHub Desktop.
Display free shipping in product loop
add_action( 'woocommerce_after_shop_loop_item_title', 'loc_show_free_shipping_badge' );
function loc_show_free_shipping_badge() {
global $post, $product;
if ( $product && $product->get_price() >= 100 ) {
echo '<span class="free-shipping">' . __( 'Livrare Gratuită!' ) . '</span>';
}
}
// based on cristian mateica post.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment