Add custom fields to simple product
-
Hi,
I’m using this approach to insert custom fields on a product.
add_action('woocommerce_product_options_general_product_data', 'woocommerce_product_custom_fields'); function woocommerce_product_custom_fields() { global $product_object; echo '<div class=" product_custom_field ">'; woocommerce_wp_text_input(array( 'id' => 'name', 'label' => __('name:', 'woocommerce'), 'placeholder' => '', 'desc_tip' => 'true' )); }
The problem is that this custom field appears in every product’s typology (simple, grouped, variable).
Is it possible to add this field only to the simple product ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add custom fields to simple product’ is closed to new replies.