Created
July 12, 2021 17:18
-
-
Save jorpdesigns/8d0464dbf504dee6e8e795c631a15d50 to your computer and use it in GitHub Desktop.
Snippet to hide WooCommerce Product Addons option price if 0
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 | |
| add_filter( 'woocommerce_product_addons_option_price', 'filter_product_addons_option_price', 10, 4 ); | |
| function filter_product_addons_option_price( $price, $option, $i, $type ){ | |
| if ( $option['price'] == 0 ) { | |
| $price = ''; | |
| } | |
| return $price; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment