Home Forums WoodMart support forum How to remove add to cart button with php

How to remove add to cart button with php

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #438385

    fineorganics
    Participant

    I want to make custom add to cart button but doesn’t know how to remove yours
    This doesn’t work: // Remove Add To cart Button
    remove_action(‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10);

    #438895

    Luke Nielsen
    Keymaster

    Hello,

    Enter the below code to the fucntions.php file in your child theme for removing the “add to cart” button.

    if ( ! function_exists( 'wd_remove_add_to_cart_button' ) ) {
    
        function wd_remove_add_to_cart_button() {
            remove_action( 'woodmart_add_loop_btn', 'woocommerce_template_loop_add_to_cart', 10 );
        }
    
        add_action( 'wp', 'wd_remove_add_to_cart_button', 240 );
    }

    In the meantime, feel free to ask me any questions you may have.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)