Skip to content

Instantly share code, notes, and snippets.

@vishalck
Created January 26, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vishalck/610bd8df57311c0f398ca238830e307c to your computer and use it in GitHub Desktop.
Save vishalck/610bd8df57311c0f398ca238830e307c to your computer and use it in GitHub Desktop.
How to Hide Prices on WooCommerce Shop and Category Pages
<?php
/**
* Snippet 1: Hide prices on all categories
* Created by: Tyche Softwares
*/
function tyches_hide_prices_on_all_categories( $price, $product ) {
if ( is_tax() ) {
return ''; // Empty string = no price!
}
return $price;
}
add_filter( 'woocommerce_get_price_html', 'tyches_hide_prices_on_all_categories', 10, 2 );
/**
* Snippet 2: Hide prices on shop pages
* Created by: Tyche Softwares
*/
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); // yes, that's it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment