WooCommerce - excelling eCommerce
Display attribute terms using a variable (1 post)

  1. valoros
    Posted 2 years ago #

    I'm trying to display the name and description for each attribute assigned to a given product. I guess the code would have to use $product->get_attributes(); and then I would like to use the name and description for each of the terms it finds as a variable which I can echo.

    I can get it working for a single attribute called 'arsenalho' using the following code:

    <?php $customepattributes = get_the_terms( $product->id, 'pa_arsenalho');
    foreach ( $customepattributes as $customepattributes ) {
    echo $customepattributes->name;
    echo "
    echo $customepattributes->description;

    How can I 'get' the value 'pa_arsenalho' and place it into a variable?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic