Skip to content

Instantly share code, notes, and snippets.

@mahdi-alavi
Created September 25, 2016 15:55
Show Gist options
  • Save mahdi-alavi/d153c63e3099b7c083f8bcfc51ba6374 to your computer and use it in GitHub Desktop.
Save mahdi-alavi/d153c63e3099b7c083f8bcfc51ba6374 to your computer and use it in GitHub Desktop.
WooCommerce Add Special Class to Free Products
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