Answer the question
In order to leave comments, you need to log in
WP - how to display custom product properties in a product category?
I use woocommerce + WP, the plugin disabled the display of the "add to cart" button.
How to display all custom properties under the product name?
Category page example: iso-dom.ru/proekty-foto-i-ceny/bani
Answer the question
In order to leave comments, you need to log in
Edit archive.php of your theme or paste archive-
product.php
public function get_attributes() {
$attributes = array_filter( (array) maybe_unserialize( $this->product_attributes ) );
$taxonomies = wp_list_pluck( wc_get_attribute_taxonomies(), 'attribute_name' );
// Check for any attributes which have been removed globally
foreach ( $attributes as $key => $attribute ) {
if ( $attribute['is_taxonomy'] ) {
if ( ! in_array( substr( $attribute['name'], 3 ), $taxonomies ) ) {
unset( $attributes[ $key ] );
}
}
}
return apply_filters( 'woocommerce_get_product_attributes', $attributes );
}
Artem, I need to display custom properties (product attributes), and not a short description.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question