• Resolved AudunBK

    (@audunbk)


    When I added the code below found on https://yithemes.com/blog/tutorials/woocommerce-extension-catalog-mode/ to functions.php in my child theme I got this error message: “There has been a critical error on this website. ” Therefore I removed the code again. I use the Divi theme. The code is on one line, does it need to be split over multiple lines to work correctly?

    add_action( 'init', 'hide_add_to_cart', 30 ); function hide_add_to_cart() { //Remove from single product page remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); //Remove from Shop/Categories pages add_filter( 'woocommerce_loop_add_to_cart_link', '__return_empty_string', 99 ); }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hide add to cart’ is closed to new replies.