WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Has anyone used the "WooCommerce Layered Nav" widget. I wonder if the attributes could be visible on the single product page?

share|improve this question

closed as off-topic by Pieter Goosen, birgire, Rarst Jun 16 '14 at 13:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

You can list all the attributes of a product by putting the following code in a template file:

global $product;
share|improve this answer
I enter this code in the single-product.php page but nothing happens, I'm doing something wrong can you help me? – Dime Nov 9 '12 at 9:24
This I found on the official site woocommerce "The layered navigation widget will only appear on product archives". I hope there is a way to solve this – Dime Nov 9 '12 at 13:11
up vote 0 down vote accepted

Finally i solve this problem:

<?php if (is_singular() ) : ?>

    <?php foreach ($attributes as $attribute) : ?>
        <h3><?php echo $woocommerce->attribute_label( $attribute['name'] ); ?></h3>
            <li><?php $values = woocommerce_get_product_terms( $product->id, $attribute['name'], 'names' );
                    echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values ); ?></li>
    <?php endforeach; ?>
<?php endif ?>
share|improve this answer

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