Created
July 29, 2016 14:55
-
-
Save jessepearson/49896ae022e65d8f24dbc8ac6799a2d9 to your computer and use it in GitHub Desktop.
Remove 'Free!' as the price for grouped products
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
| <?php // do not copy this line unless needed | |
| /** | |
| * Remove 'Free!' as the price for grouped products | |
| * | |
| * @param $price string The price | |
| * @param $prod object The product | |
| * @return string The original or modified price. | |
| */ | |
| function remove_free_as_grouped_product_price( $price, $prod ) { | |
| if ( 'Free!' === $price ) { | |
| $price = ''; | |
| } | |
| return $price; | |
| } | |
| add_filter( 'woocommerce_grouped_free_price_html', 'remove_free_as_grouped_product_price', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment