Answer the question
In order to leave comments, you need to log in
How to display a specific attribute of a product in a catalog in woocommerce?
Good evening.
There is a task to implement on the wokomertz, in the catalog, the output of product sizes, as here
.
Of course, I can take the stupid code from the product-attributes.php file, but then everything will be displayed.
And I only need size . Substitute size here
if ( empty( $attribute['is_visible'] ) || ( $attribute['is_taxonomy'] && ! taxonomy_exists( $attribute['name'] ) ) ) {
continue;
} else {
$has_row = true;
}
?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<th><?php echo wc_attribute_label( $attribute['name'] ); ?></th>
Answer the question
In order to leave comments, you need to log in
wp-panda.com/woocommerce_posts/display-product-dim...
global $product;
$dimensions = $product->get_dimensions();
Here is a fairly detailed description for displaying attributes in the catalog or on the product page:
webreason.ru/vyvod-atributov-tovara-woocommerce
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question