Skip to content
Advertisement

Get custom product attributes in Woocommerce

In Woocommerce, I am trying to get product custom attribute values but I fail miserably and I don’t get anything.

So I tried:

JavaScript

And I’m getting this raw data:

JavaScript

I know that there is a value because it is shown in the attribute section, but I just can’t find a way to get it displayed with my custom code.

Advertisement

Answer

Edited: The woocommerce_get_product_terms is deprecated since Woocommerce version 3

Go with the following as @datafeedr wrote in his answer:

JavaScript

or even more compact:

JavaScript

Original answer:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement