WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WooCommerce - excelling eCommerce] Display “per attribute” link in pro (1 post)

  1. cicciosax2
    Member
    Posted 1 year ago #

    I've been seeking everywhere to find a tip which should be obvious in WordPress/Woocommerce. I want to make attribute values displayed in the product page as archive links each automatically generated. Does anyone know how to do that? The code is the standard one and produces a result which is not a link (I would like it to be clickable) :

    <?php
                if ( $attribute['is_taxonomy'] )  {
    
                    $values = woocommerce_get_product_terms( $product->id, $attribute['name'], 'names' );
                    echo  apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values ) ;
    
                } else {
    
                    // Convert pipes to commas and display values
                    $values = array_map( 'trim', explode( '|', $attribute['value'] ) );
                    echo apply_filters( 'woocommerce_attribute', wpautop( wptexturize( implode( ', ', $values ) ) ), $attribute, $values );
    
                }
            ?>

    Can Anyone help? Thanks! F.

Topic Closed

This topic has been closed to new replies.

About this Topic