Writing custom code to create product detail page with wordpress database.
I have displayed product title, desc, price, stock, etc and got stuck up with product attributes. In the database, _product_attributes is stored in serialized manner in wp_postmeta table in database. And i couldn't unserailize attributes from it. But i found, each attribute value with it own price has been stored in wp_postmeta in some other post_id.
for example, product with post_id=55 has attribute name 'Size value' having values 14 and 18 and price 300 and 350, is displayed as attributes value and price in post_id=110,111
is there any formula behind? Any idea to find this product attribute value and corresponding price value?
$array = unserialize('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;}}'); $var = $array['pa_size-value'];
I can extract array but after that?????? – Slopwork