Single Product "Add To Cart" Button Delete? HTML CODE. (2 posts)

  1. Kenzan
    Posted 2 years ago #

    Hi, I'm looking for HTML to input into various product pages to delete the 'add to cart' button?

    The reason. I have an ESCROW button to add in place on various product pages.

    I could either delete all of the cart buttons, and add the escrow buttons and add 'add to cart button' individually.

    or delete 'add to cart manually on the ones I don't require, this is what I would like to do BUT, every SINGLE CODE I've used here on the forums don't work?

    Any help would be appreciated, thank you.


  2. Chrome Orange
    Posted 2 years ago #

    You can remove the add to cart button from the single product page by adding this to your theme functions.php file

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

    But that will remove it on every product.

    If you want to be selective then you need a function and a way of letting that function know that the Escrow button is there.

    If the Escrow button is being added using a short code in the content then something like this http://wordpress.stackexchange.com/questions/40733/check-for-shortcode-in-post-pages-and-widgets-and-template-files will let you detect the short code and you can then use remove_action above

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic