D
D
DeniSidorenko2019-04-06 11:35:56
WooCommerce
DeniSidorenko, 2019-04-06 11:35:56

Woocommerce how to get list of attributes in Single-product.php?

Good afternoon, in the file content-product.php I display the attributes in the following way

global $product;
$attributes = $product->get_attributes();

In a single-product file, namely content-single-product, this method does not work. How can I get the attributes on the product page

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Yanchevsky, 2019-04-06
@deniscopro

And so it works?

$product = wc_get_product();
$attributes = $product->get_attributes();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question