WooCommerce prices location in DB

All the data like different prices of a product custom post type are store (for each product) in postmeta table. To find the post id of all products you have to use this query on posts table: SELECT * FROM ‘posts’ WHERE ‘post_type’ = ‘product’ For each product id (post_id), you can retrieve all related … Read more

Get woocommerce product price by id [closed]

You can create a product object using the following function: $product = wc_get_product( $post_id ); And after that you will be able to access to all product’s data. All available methods can be found here, but the ones you need are: $product->get_regular_price(); $product->get_sale_price(); $product->get_price();