get woocommerce product image url and price from database [closed]
The only way I see is to use nested WHERE clause: SELECT p.*, pm2.meta_value as image_file FROM ( SELECT p.ID, p.post_title, `post_content`, `post_excerpt`, t.name AS product_category, t.term_id AS product_id, t.slug AS product_slug, tt.term_taxonomy_id AS tt_term_taxonomia, tr.term_taxonomy_id AS tr_term_taxonomia, MAX(CASE WHEN pm1.meta_key = ‘_price’ then pm1.meta_value ELSE NULL END) as price, MAX(CASE WHEN pm1.meta_key = ‘_sku’ … Read more