Skip to content

Instantly share code, notes, and snippets.

@chrdesigner chrdesigner/functions.php
Last active Aug 25, 2015

Embed
What would you like to do?
Function - Show the price only after logging
<?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
You can’t perform that action at this time.