HelloARI logo: vinyl signs and identity design home«    web design«    sign design«    blog«    contact« 

web design and wordpress development 94114
blog»
san frnacisco web design

How to remove / deactivate buy button on WooCommerce

0 Flares 0 Flares ×

WooCommerce is the best eCommerce plugin for WordPress. All workflows are processed smoothly from backend to frontend. My team and I are able to adapt it to match the customized needs of my clients. Users generally find it easy to use.

But sometimes stores want to disable the purchase process (remove the cart and the buy button from the product page) — for a variety of scenarios:

  • I was migrating a site from one server to another and wanted to make sure no orders were “trapped” on the old server once I edited the DNS records to point to the new server.
  • For other kinds of test environments or site copies that might be seen in limited scenarios or edge cases.
  • Some stores  just want to display their products, as a display catalog and not for purchasing.  

You can use this code to remove the buy button from the product page:

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', 30 );

Place the code above in functions.php of your active theme.

Here’s a screenshot:

Before:

After:

This may not work with every theme and every setup. Learn more and see more complex code options at wordpress.stackexchange.com 

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
This entry was posted in WordPress, WordPress WooCommerce. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*

 

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

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
© 2018
contact  |  links  |  rss