0

I couldn't able to get attribute values from woocommerce taxonomy. I have tried

select meta_value from wp_postmeta where meta_key = '_product_attributes' and post_id = '55';

It gives an array

a:1:{s:13:\"pa_size-value\";a:6:{s:4:\"name\";s:13:\"pa_size-value\";s:5:\"value\";s:0:\"\";s:8:\"position\";s:1:\"0\";s:10:\"is_visible\";i:1;s:12:\"is_variation\";i:1;s:11:\"is_taxonomy\";i:1;}}

With these array values having attribute value as null, i dono how to proceed. I creating a custom code, not with woocommerce functions.

Could you mention how to walk around with woocommerce taxonomy? and process flow to display attribute values?

1
  • it is better to edit first question then ask another. Commented Feb 26, 2014 at 11:16

2 Answers 2

2

You need to connect data from 3 tables:
_term_taxonomy (name of attribute)
_terms (value of attribute)
_term_relationships (link between object and attribute)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I figured out the process flow and coding using your answer.
0

For a variable product(having price for each attribute), to get attribute value

_term_taxonomy (name of attribute)

_terms (value of attribute)

_term_relationships (link between object and attribute)

to get price for each attribute,

_options (option_value where option_name= _transient_wc_product_children_ids_productid)

_postmeta (price using optoin_value)

here mention your productid in _transient_wc_product_children_ids_productid

I hope it helps for those who create app dependant wordpress site.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.