I imported around 7000 products into a WooCommerce project I'm working on, and each product has specifications, and I would like to display them in a table, like something you would see on Amazon for example.

I imported the specifications into custom fields. I am not even sure if it is best to import them as custom fields or if there is a better way to do it.

I found a few plugins that can display a table, but all of them required me to enter the info manually.

I want something that will work automatically using the custom fields.

Also, Every category will have different custom fields, so I want something that will work per category.

I attached a picture of what I would like to achieve. specifications table

  • What is your question? Now it looks like a design specification for the freelancer.
    – Max Yudin
    Commented Mar 8, 2019 at 20:17

1 Answer 1


How are the custom fields saved? If you use ACF - Advanced custom fields, you can use get_field() function to get the variables.

This should get you started. You can use another action hook or priority if you want the table to be displayed somewhere else.

function display_product_table(){
  global $product;

  <table class="shop_attributes">
      <th><?php _e( 'Brand', 'woocommerce' ) ?></th>
      <?php // example if you use acf - advanced custom fields?>
      <td class="product_brand"><?php //echo get_field('brand'); ?></td>
    <?php if ( $product->has_weight() ) : ?>
            <th><?php _e( 'Weight', 'woocommerce' ) ?></th>
            <td class="product_weight"><?php echo esc_html( wc_format_weight( $product->get_weight() ) ); ?></td>
    <?php endif; ?>

    <?php if ( $product->has_dimensions() ) : ?>
            <th><?php _e( 'Dimensions', 'woocommerce' ) ?></th>
            <td class="product_dimensions"><?php echo esc_html( wc_format_dimensions( $product->get_dimensions( false ) ) ); ?></td>
    <?php endif; ?>

add_action( 'woocommerce_single_product_summary', 'display_product_table', 45);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.