wordpress.org – Attribute class name

Question

Helo Sir,
I want to display class name of product attribute in product additional information attributes

if( taxonomy_exists($taxonomy) ){
$label_name = wc_attribute_label( $taxonomy, $product );

        $term_names = $product->get_attribute( $taxonomy );

        if( ! empty($term_names) ){
            $attr_output[] = '<span class="'.$taxonomy.'">'.$label_name.': '.$term_names.'</span>';
        }
    }
}

0
Ruby 5 days 2022-11-25T06:35:28-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse