Last active
August 25, 2015 23:35
-
-
Save chrdesigner/bb9371f608ee20428631 to your computer and use it in GitHub Desktop.
Function - Show the price only after logging
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
<?php | |
/* | |
* Function - Show the price only after logging | |
*/ | |
add_filter('woocommerce_get_price_html','show_price_logged'); | |
function show_price_logged($price){ | |
if( is_user_logged_in() ){ | |
return $price; | |
} else { | |
return '<a href="' .get_permalink(woocommerce_get_page_id('myaccount')). '" title="Já tenho Conta" class="btn-myaccount">Já tenho Conta</a> ou <a href="' .get_permalink(woocommerce_get_page_id('myaccount')). '" title="Registrar para visualizar o preço!" class="btn-registrar">Registrar para visualizar o preço!</a>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment