Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'woocommerce_get_price_html', 'product_price_html', 10, 2 );
- add_filter( 'woocommerce_variable_sale_price_html', 'product_price_html', 10, 2 );
- add_filter( 'woocommerce_variable_price_html', 'product_price_html', 10, 2 );
- function product_price_html($price, $product) {
- if ( in_array($product->get_id(), [1, 5, 7])) { // if product ID's "1, 5 or 7"
- $price = __('Price is hidden');
- }
- return $price;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement