Tagged: Cart, Catalog Visibility Options, woocommerce
Hi there,
Love the theme, especially the work you have put into the admin side with the avia framework. Need some help with woocommerce though. Building a site where the client does not want to sell directly online yet – just use woocommerce as a catalog. So we bought the woocommerce extension Catalog Visibility Options to disable the cart. However, although the options are correct in the Catalog Visibility Options extension (disable purchases, enable prices) the “add to cart” button is still showing in the product loop, and the ajax cart is still active. Can you help disable these properly, not just hide through css?
Thanks.
Hi wildmercury!
You can add this on functions.php, at the very bottom:
remove_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16);
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
Regards,
Ismael
Are you sure? That just white-paged the site!
Hi,
Can you create an administrator account and post it here as a private reply?
Regards,
Josue
Hi!
Yes, the code works on my end. If it doesn’t work on functions.php, please config-woocommerce > config.php. Add the code at the very bottom. Also, please try this at the bottom of functions.php:
add_action('init','remove_add_to_cart_button');
function remove_add_to_cart_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'avia_add_cart_button', 16);
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
}
Cheers!
Ismael
ok thanks – that works.
Perfect Ismael!