From: Laury GvR Date: Tue, 19 Apr 2016 19:45:07 +0000 (-0400) Subject: Trying to add the SKU X-Git-Tag: v1.0.0^2~20 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=32c6c47e47366bd0256b247992d8a5aff1c18716;p=WP-Themes%2Fjollylama.git Trying to add the SKU --- diff --git a/functions.php b/functions.php index 54f492f..3fd5533 100644 --- a/functions.php +++ b/functions.php @@ -92,7 +92,6 @@ function woo_product_inquiry_tab( $tabs ) { } function woo_product_inquiry_content() { global $product; - echo "TEST123 ".$product->get_sku(); echo do_shortcode('[gravityform id="2" title="true" description="true" values="product_sku='.$product->get_sku().'"]'); } add_filter( 'gform_field_value_product_name', 'gform_add_product_name_field' ); @@ -103,7 +102,7 @@ function gform_add_product_name_field( $value ) { add_filter( 'gform_field_value_product_sku', 'gform_add_product_sku_field' ); function gform_add_product_sku_field( $value ) { global $product; - return $product->get_sku(); + return ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); } /* Header for posts*/