📌  相关文章
📜  从 caritem woocommerce 获取正常价格 - 无论代码示例

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

代码示例2
cart->get_cart();

        foreach($items as $item => $values) { 
            $_product =  wc_get_product( $values['data']->get_id() );
            //product image
            $getProductDetail = wc_get_product( $values['product_id'] );
            echo $getProductDetail->get_image(); // accepts 2 arguments ( size, attr )

            echo "".$_product->get_title() .'  
Quantity: '.$values['quantity'].'
'; $price = get_post_meta($values['product_id'] , '_price', true); echo " Price: ".$price."
"; /*Regular Price and Sale Price*/ echo "Regular Price: ".get_post_meta($values['product_id'] , '_regular_price', true)."
"; echo "Sale Price: ".get_post_meta($values['product_id'] , '_sale_price', true)."
"; } ?>