Created
May 18, 2018 12:25
-
-
Save rwkyyy/59a9bbe84e667fcadd60c416f6f051c0 to your computer and use it in GitHub Desktop.
Display free shipping in product loop
This file contains 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_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