In WooCommerce, it is possible to display Product Attributes (or what’s normally shown under the “Additional Information” tab) right under the price on the single product page instead of inside a tab. In fact, you can display the entire contents of the “Additional Information” tab right under the price, and remove the tab alltogether! This will save your customers some time clicking around to see relevant information about your products. Allow me to show you how it’s done!
WooCommerce: Show Attributes Below Price
There are multiple ways to do this, but I chose to do this with a code snippet, so that’s what I’ll be sharing with you today.
First, you need the Code Snippets plugin. If you have this plugin installed, take these steps:
- Go to your WordPress dashboard.
- Navigate to Snippets > Add New.
- Give your snippet a name, like “Show Attributes Under Price”.
- Paste this code into the code area:
add_action('woocommerce_single_product_summary', 'show_attributes_under_price', 11);
function show_attributes_under_price() {
global $product;
if ( $product->has_attributes() ) {
echo '<div class="product-attributes" style="margin-top:10px;">';
foreach ( $product->get_attributes() as $attribute ) {
if ( $attribute->get_visible() && !$attribute->is_taxonomy() ) {
echo '<p><strong>' . wc_attribute_label($attribute->get_name()) . ':</strong> ' . implode(', ', $attribute->get_options()) . '</p>';
}
if ( $attribute->get_visible() && $attribute->is_taxonomy() ) {
$terms = wc_get_product_terms( $product->get_id(), $attribute->get_name(), array( 'fields' => 'names' ) );
echo '<p><strong>' . wc_attribute_label($attribute->get_name()) . ':</strong> ' . implode(', ', $terms) . '</p>';
}
}
echo '</div>';
}
}
Set the snippet to “Run snippet everywhere”.
Click Save Changes and Activate.
That’s it! It should now display the product attributes right under the price on single product pages.
Show Additional Information Below Price
In WooCommerce, you can opt to show everything from the “Additional Information” tab (which usually includes both visible attributes and dimensions/weight, if set) below the price instead, essentially replacing the need for that tab.
Here’s a tweaked version of the code that includes:
✅ All visible product attributes (both custom and taxonomy-based)
✅ The product dimensions and weight, if they exist
add_action('woocommerce_single_product_summary', 'move_additional_info_under_price', 11);
function move_additional_info_under_price() {
global $product;
echo '<div class="woocommerce-product-details__additional-info" style="margin-top:15px;">';
// Show attributes
if ( $product->has_attributes() ) {
foreach ( $product->get_attributes() as $attribute ) {
if ( $attribute->get_visible() ) {
if ( $attribute->is_taxonomy() ) {
$terms = wc_get_product_terms( $product->get_id(), $attribute->get_name(), array( 'fields' => 'names' ) );
$value = implode(', ', $terms);
} else {
$value = implode(', ', $attribute->get_options());
}
echo '<p><strong>' . wc_attribute_label( $attribute->get_name() ) . ':</strong> ' . esc_html( $value ) . '</p>';
}
}
}
// Show weight
if ( $product->has_weight() ) {
echo '<p><strong>' . __('Weight') . ':</strong> ' . esc_html( $product->get_weight() ) . ' ' . get_option( 'woocommerce_weight_unit' ) . '</p>';
}
// Show dimensions
if ( $product->has_dimensions() ) {
echo '<p><strong>' . __('Dimensions') . ':</strong> ' . wc_format_dimensions( $product->get_dimensions( false ) ) . '</p>';
}
echo '</div>';
}
If you want to hide the “Additional information” tab, since it is now practically useless, add this code below the previous code within the same snippet:
add_filter('woocommerce_product_tabs', 'remove_additional_info_tab', 98);
function remove_additional_info_tab($tabs) {
unset($tabs['additional_information']);
return $tabs;
}
That’s it! You’ve now successfully removed the Additional Information tab in WooCommerce, and placed the contents and attributes right below the price of your product on the Single Product page.
♥ I hope my post was useful to you! If this post helped you in any way, please consider supporting me by making a small donation via my Ko-Fi page!