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 - Remove Loop/Single Button Add to Cart
<?php
/*
* Function - Remove Loop/Single Button Add to Cart
*/
add_action('init','remove_add_to_cart');
function remove_add_to_cart(){
if(is_user_logged_in()){}else{
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 );
}
}
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.