📌  相关文章
📜  woocommerce 订单获取产品重量 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:33.697000             🧑  作者: Mango

代码示例1
$item_weight=wp_get_post_terms($post->ID, 'pa_weight', array("fields" => "names"));

$send_array[] = array(

    'id' => get_the_ID(),
    'title' => get_the_title(),
    'content' => get_the_content(),
    'regular_price' => get_post_meta( get_the_ID(), '_regular_price', true),
    'sale_price'=> get_post_meta( get_the_ID(), '_sale_price', true),
    'weight' => $item_weight[0]

);