how can i Hide prices and checkout functionality in woocommerce ?

adriel

Newbie
Messages
14
Likes
0
Points
1
Hello,

My client has a woocommerce store with 30-40 products. For whatever reason they do not want to sell online anymore, but they want to retain the product pages, information, etc. on their website.

Is there a way, using hooks or otherwise, to hide things like prices, add to cart button, etc. in woocommerce? Or should I just edit the php template files?

Thanks
 
Hello,

woocommerce has many hooks, this removes prices and buttons:
Code:
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );

you can find into content-product.php and content-single-product.php if you need to remove more stuff.
 

Members online

No members online now.