Quantcast
Channel: WooCommerce prices location in DB - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 5

Answer by Marcel Lange for WooCommerce prices location in DB

$
0
0

As LoicTheAztec told, the product data lives in the posts and postmeta tables. Here is a query, I used to get the prices in my environment (WC Role Based Price installed)

SELECT  wpp.ID,  wppm.meta_key AS FIELD,  wppm.meta_value AS VALUE,  wppm.*FROM wp_posts AS wpp  LEFT JOIN wp_postmeta AS wppm    ON wpp.ID = wppm.post_idWHERE wpp.post_type = 'product'      AND (wppm.meta_key = '_regular_price'      OR wppm.meta_key = '_sale_price'      OR wppm.meta_key = '_price'      OR wppm.meta_key = '_product_attributes')ORDER BY wpp.ID ASC, FIELD ASC, wppm.meta_id DESC;

Perhaps this is helpful.


Viewing all articles
Browse latest Browse all 5

Trending Articles