Bu şekilde WP_Query üzerinden tüm ürünler alabilirsiniz
$full_product_list = array();
$loop = new WP_Query(array('post_type' => array('product', 'product_variation'), 'posts_per_page' => -1));
while ($loop->have_posts()) : $loop->the_post();
$theid = get_the_ID();
$product = new WC_Product($theid);
if (get_post_type() == 'product_variation') {
// ****************** end error checking *****************
} else {
$sku = get_post_meta($theid, '_sku', true);
$selling_price = get_post_meta($theid, '_sale_price', true);
$regular_price = get_post_meta($theid, '_regular_price', true);
$description=get_the_content();
$thetitle = get_the_title();
}
// add product to array but don't add the parent of product variations
if (!empty($sku))
$full_product_list[] = array("PartyID" => (int) $party_id,"Description"=> $description,
"ExternalNumber" => $theid, "ProductName" => $thetitle, "sku" => $sku,
"RegularPrice" => $regular_price, "SellingPrice" => $selling_price,
"ExternalProductCategoryId" => $cat_id, "ExternalProductCategoryName" => $cat_name);
endwhile;
Gibi woocommerce eklentisinde, tüm templet zaten bulunur ve kodu özel templetinize kopyalar. e.they meta eklenmiş özel posta türleri vardır, ayrıca özel yazı tipi sorgu kullanabilir ve yazı meta yöntemi –
olsun Sadece arkadaşça bir ipucu, bu sayfa üzerinden okumak isteyebilirsiniz: [Nasıl Yapılır Kılavuzu] (https: //stackoverflow.com/help/how-to-ask) böylece her zaman sorularınızın kolayca cevaplanabilir olduğundan ve olabildiğince açık olduğundan emin olabilirsiniz. Yaşadığınız sorunu çözmek için yaptığınız tüm çabaları ve bu düzeltmeleri denediğinizde ne olduğunu eklemeyi unutmayın. Ayrıca kodunuzu ve herhangi bir hata mesajınızı da unutmayın! –
Tüm ürün verileri meta veridir. Ama Matthew’a katılıyorum, ne sorduğun belli değil. – helgatheviking