Skip to content

Instantly share code, notes, and snippets.

View michelmany's full-sized avatar

Michel Moraes michelmany

View GitHub Profile
@michelmany
michelmany / remove-price-woocommerce.php
Last active August 29, 2015 14:24
REMOVE PREÇOS E BOTÃO DE ADICIONAR NO CARRINHO PARA USUÁRIOS NÃO LOGADOS
function cs_prices_only_for_logged_in_users() {
if ( ! is_user_logged_in() ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
}
}