I’ve been inspecting woocommerce database scheme, most of the details make sense except i can’t seem to find in which table the attribute title is stored. The sample product in the image has different selections for product colour , i can see the attribute coulour values from the database , but i can’t seem to find where the colour attribute tittle gets stored
, look at the red arrow to see the detail am asking about.
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
with a prefix ‘pa_’.
their name and slug. To link the attributes to the product
Woocommerce use ‘wp_term_relationships’ table to store the mapping
of the post/product ID with the term ID.
serialized way in ‘wp_postmeta’ table under meta_key =>
_product_attributes.
So to resume: Attributes names are displayed from ‘_product_attributes’ meta_key and the values are displayed from ‘wp_terms.name’.
It’s all in the database but I don’t recommend accessing the data directly from the database, use the built-in functions instead.
Product attributes are one of the not-so-nice-things in WooCommerce. They look like a taxonomy, but aren’t.
The attributes name is stored in
wp_woocommerce_attribute_taxonomies
You may have a look into WooCommerce’ documentation to find filters for attributes: https://woocommerce.github.io/code-reference/hooks/hooks.html