Skip to content
Advertisement

Display woocommerce product dimensions in separate lines

I found the way to display the dimensions in separate lines by copy product-attributes.php file to my child-theme and replace:

JavaScript

with:

JavaScript

The problem is that the products don’t always have 3 dimensions… And then it look like this:

Screen Shot

How can I display only the relevant rows?

Advertisement

Answer

Updated: You can do it this way adding a condition for each dimension kind this way:

JavaScript

Tested and works.

Note: This doesn’t handle variable products that uses Javascript to update the formatted dimensions on selected product variations.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement