• Resolved Taufan

    (@taufanxxx)


    Hi,
    I know we can disable Add to Cart Button on Module “Projects” >> “Product Add to Cart” >> “Add to Cart Button Disabling”.

    But it’s need to set one by one.
    How to disable “Add to Cart Button” on Product category/archieve/related-post only (not on single product) globally to entire site.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hello @taufanxxx,

    I think this is what you are looking for:

    add_action( 'woocommerce_after_shop_loop_item', function(){
    	remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    }, 1 );

    Try to put this piece of code on your functions.php please.
    It will remove the add to cart button on product loop. I.e Product category/archive/related

    Let me know it that helped you, thanks.

    Thread Starter Taufan

    (@taufanxxx)

    Hi @karzin,
    It’s work. Many thanks.
    May God bless you and your family.

    I’m happy to hear that.
    Thanks ??

    Hi,

    If you’d like to use Booster plugin instead of code snippet – I’ve just added it to the plugin. If you wish to check it out, the development version is here – https://booster.io/dev/. Now in “Product Add to Cart” module (in “WooCommerce > Settings > Booster > Products > Product Add to Cart”) in “Add to Cart Button Disabling” section I’ve added two checkboxes: “Disable Add to Cart Buttons on All Single Product Pages” and “Disable Add to Cart Buttons on All Category/Archives Pages”.

    Best regards,
    Tom

    • This reply was modified 7 years, 9 months ago by Algoritmika.
    • This reply was modified 7 years, 9 months ago by Algoritmika.

    @karzin
    That code worked perfectly for removing the buttons on the “Related Products” as well as the shop and category pages. Thank you very much for solving the mystery I’ve been trying to solve for hours.

    Have a great day!

    I’m glad to hear
    ??

    See you

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to disable Add to Cart Button on Product archieve’ is closed to new replies.