Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #820800

    I have seen many past threads with CSS code that doesn’t work, hooks that go in functionsa.php that do not remove, please advise on the way to do this with the current version of enfold and current version of Woo commerce. Thanks in advance.

    #821176

    Hey ejo14,

    Here is an article on how to do it
    https://www.cloudways.com/blog/how-to-remove-hide-or-disable-add-to-cart-button-in-woocommerce/

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #821246

    I previously found that article and added the following to both functions.php and then woocommerce.php and neither worked to successfully remove the add to cart button

    function WC() {
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’);
    remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’);
    return WooCommerce::instance();
    }

    Also, my fear is this is not a good solution as placing any kind of code inside the plugin itself will cause the modification to disappear after the next plugin update.

    #821247

    Hi,

    Please try adding following code to functions.php file in Appearance > Editor

    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );

    Best regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.