Home Forums WoodMart support forum Remove add to cart button (NOT CSS)

Remove add to cart button (NOT CSS)

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

    minhhieu7613
    Participant

    Hello!
    How can i remove add to cart from product archive?
    I used this hook
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’);
    but no effect.

    Thank you so much!

    #569269

    Luke Nielsen
    Member

    Hello,

    Enter the code below into the fucntions.php file in your child theme to remove 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

    #569425

    minhhieu7613
    Participant

    It’s working. Thank you so much!

    #569432

    Luke Nielsen
    Member

    Hello,

    You are welcome! If you do not mind, can you please leave a 5 stars rating for our theme by going here: http://themeforest.net/downloads It will allow us to release more updates and provide dedicated support in the future. It would encourage our work a lot.

    Have a good day!

    Kind Regards

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

The topic ‘Remove add to cart button (NOT CSS)’ is closed to new replies.