I made custom field in product backend, that I want to be only for Product type pw-gift-card:
function creating_final_sku_field(){
global $product;
if ($product->is_type('pw-gift-card')) {
$args = array(
'label' => __( 'Final SKU', 'woocommerce' ),
'placeholder' => __( 'Enter final SKU here', 'woocommerce' ),
'id' => 'final_sku',
'desc_tip' => true,
'description' => __( 'This SKU is for final use only.', 'woocommerce' ),
);
woocommerce_wp_text_input( $args );
}
}
add_action( 'woocommerce_product_options_sku', 'creating_final_sku_field' );
This is code throws a critical error.
Any help is appreciated.
