For some products, it be necessary to make clear that the dimensions planes listed in the attributes table is in the format Length x Width x Height. This guide shows you how you can add the suffix (LxWxH) to the product dimensions shown in the attributes table under the Additional Information tab.
/**
* Snippet Name: WooCommerce show product attribute dimensions (LxWxH) suffix
* Snippet Author: ecommercehints.com
*/
add_filter( 'woocommerce_format_dimensions', 'ecommercehints_dimensions_suffix', 20, 2 );
function ecommercehints_dimensions_suffix( $dimension_string, $dimensions ) {
$dimension_string = implode( ' x ', array_filter( array_map( 'wc_format_localized_decimal', $dimensions ) ) );
if ( ! empty( $dimension_string ) )
$dimension_string .= ' ' . __("(LxWxH)", "woocommerce");
return $dimension_string;
}