Custom Field to Additional Information
-
hello,
I want to add custom fields to the Additional Information tab
I found this code that does it perfectlyfunction yourprefix_woocommerce_display_product_attributes($product_attributes, $product){ $product_attributes['customfield'] = [ 'label' => __('custom', 'text-domain'), 'value' => get_post_meta($product->get_ID(), 'customfield', true), ]; return $product_attributes; } add_filter('woocommerce_display_product_attributes', 'yourprefix_woocommerce_display_product_attributes', 10, 2);is it possible to change it so it would show the field label instead of the value of the field?
e.g
value: red
label: the color redthanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Custom Field to Additional Information’ is closed to new replies.