Created
February 18, 2025 17:04
-
-
Save plugin-republic/4469e251e09be6aa5a80770bbf0974c1 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Filter price for non-logged-in users | |
*/ | |
function pr_demo_get_price_html( $price, $product ) { | |
if( !is_user_logged_in() ) { | |
// Add a custom message here to display instead of the price | |
return __( 'Price on application', 'your_textdomain' ); | |
} | |
return $price; | |
} | |
add_filter( 'woocommerce_get_price_html', 'pr_demo_get_price_html', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment