Display Message When Product Form is Disabled

Instructions

Code

Filename: gspc-display-message-when-product-form-is-disabled.php

<?php
/**
 * Gravity Shop // Product Configurator // Display Message When Product Form is Disabled
 * * https://gravitywiz.com/documentation/gravity-shop-product-configurator/
 *
 * Instructions:
 *
 * 1. Install this snippet per https://gravitywiz.com/documentation/managing-snippets/#where-do-i-put-snippets
 */
add_action( 'woocommerce_single_product_summary', function() {
	global $product;

	if ( ! function_exists( 'gs_product_configurator' ) ) {
		return;
	}

	if ( ! gs_product_configurator()->wc_product_display->is_product_form_disabled( $product ) ) {
		return;
	}

	echo '<p>' . esc_html__( 'Sorry. This form is no longer available.', 'gravityforms' ) . '</p>';
} );

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.