Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where table contain the price of product in wooecomerce?

I'm using wordpress and woocommerce to develop ecommerce store, I want to get price of product, but I didn't see where the price of product in database? I search in google and said that it in table wp_postmeta, but I didn't see anything? so how can I find where the price of product in database of woocommerce.

like image 929
dev.rocket Avatar asked Oct 17 '25 18:10

dev.rocket


1 Answers

Basically WooCommerce saves its products data in the structure of WordPress database as a custom post with 'Post Type' as 'product'.

All the other metadata related to the posts are in 'postmeta' table of WordPress Database. You can find the structure of this table as 'meta_id', 'post_id',''meta_id' and 'meta_key'.

The prices for products will be with 'post_id' as product's id and 'meta_key' as '_regular_price' and 'meta_key' as the value of the regular price which you have set.

So all the other metadata related to products are in 'postmeta' table. Rather than using manually querying the WordPress database , WooCommerce made it ease with a handful of functions which you can use directly to get the pricing. Try that too which might reduce your development time.

like image 126
Domain Avatar answered Oct 19 '25 11:10

Domain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!