Salve a tutti.
Con questa query riesco ad estrarre l’ID, il titolo e l’immagine del prodotto:
SELECT ID, post_title,
(SELECT guid FROM wp_posts WHERE post_type ='attachment' AND post_parent=wp.ID
ORDER BY post_date ) AS attachment FROM wp_posts wp WHERE wp.post_status = 'publish' AND wp.post_type = 'product' HAVING attachment IS NOT NULL ORDER BY RAND()
Devo estrarre anche il prezzo, qualcuno può aiutarmi?
Grazie in anticipo (Scusate se sbaglio sezione).