Created
September 25, 2016 15:55
-
-
Save mahdi-alavi/d153c63e3099b7c083f8bcfc51ba6374 to your computer and use it in GitHub Desktop.
WooCommerce Add Special Class to Free Products
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
function itl_add_class_free_products( $price ) { | |
$price = '<span class="amount free-product">' . __( 'Free!', 'woocommerce' ) . '</span>'; | |
return $price; | |
} | |
add_filter( 'woocommerce_variable_free_price_html', 'itl_add_class_free_products' ); | |
add_filter( 'woocommerce_free_price_html', 'itl_add_class_free_products' ); | |
add_filter( 'woocommerce_variation_free_price_html', 'itl_add_class_free_products' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment