Reputation: 690
I am trying to add a row to Single product Additional information table.
Actually is there any hooks or filter to do this? I have searched the hook but can't figure out the solution.
Any help is appreciated.
Upvotes: 3
Views: 2278
Reputation: 253794
Since WooCommerce version 3.6, you can use woocommerce_display_product_attributes
filter hook in this simple way, to add custom label/value pairs in "Additional Information" table (tab):
add_filter( 'woocommerce_display_product_attributes', 'custom_product_additional_information', 10, 2 );
function custom_product_additional_information( $product_attributes, $product ) {
// First row
$product_attributes[ 'attribute_' . 'custom-one' ] = array(
'label' => __('Label One'),
'value' => __('Value 1'),
);
// Second row
$product_attributes[ 'attribute_' . 'custom-two' ] = array(
'label' => __('Label Two'),
'value' => __('Value 2'),
);
return $product_attributes;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and work.
Upvotes: 6