Skip to content (Press Enter)

marioernestoms

WordPress Specialist

  • About

WooCommerce – Remove add to cart button

by marioernestomsupdated on 18 de December de 201918 de December de 2019

This week to maintain a customer’s e-commerce, he requested that the add to cart button be removed. After much searching I found this solution. And as other people may need I decided to share here the good way to do this.

You need only put the code below in your functions.php file.

/**
 * Hide add to cart buttons.
 */
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' );
add_filter( 'woocommerce_is_purchasable', '__return_false' );

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

WordPress
0

marioernestoms

Post Navigation

Previous Article
Next Article

Recent Posts

  • WooCommerce – Block add to cart button
  • WooCommerce – Remove add to cart button
  • Ajax Login System with WordPress
  • How to install WordPress on VPS with SSH
  • Troubleshoot WordPress update failure message

Categories

  • HTML/CSS/JS
  • Servidores
  • WordPress
An automated wordpress update failure
Recommended for you...

Troubleshoot WordPress update failure message

by marioernestoms
WordPress ask to FTP credentials to install plugins
Recommended for you...

WordPress ask to FTP credentials to install plugins

by marioernestoms
Recommended for you...

WooCommerce – Block add to cart button

by marioernestoms

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Copyright 2021 marioernestoms. All Rights Reserved. The Ultralight | Developed By Rara Theme. Powered by WordPress.