dev.rocket
dev.rocket

Reputation: 175

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.

Upvotes: 4

Views: 4056

Answers (1)

Domain
Domain

Reputation: 11808

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.

Upvotes: 4

Related Questions