07-27-2023, 10:52 AM
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
![wp_postmeta][1]
![wp-postmeta-example][2]
is there any formula behind? Any idea to find this product attribute value and corresponding price value?
[1]:
[2]:
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
![wp_postmeta][1]
![wp-postmeta-example][2]
is there any formula behind? Any idea to find this product attribute value and corresponding price value?
[1]:
[2]: