Hide Woo Price For All GSPC Products

Hide the price for all GSPC products in the shop, archive and single product pages.

Instructions

Code

Filename: gspc-hide-woo-price.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
/**
 * Gravity Shop // GS Product Configurator // Hide Woo Price For All GSPC Products
 * https://gravitywiz.com/documentation/gravity-shop-product-configurator/
 *
 * Hide the price for all GSPC products in the shop, archive and single product pages.
 *
 * Instructions:
 *   1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
 */
add_filter( 'woocommerce_get_price_html', function( $price, $product ) {
	if ( ! is_admin() && gspc_get_product_form_id( $product ) ) {
		return '';
	}
	return $price;
}, 10, 2 );

Leave a Reply

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

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.