카테고리 없음

[PHP] WooCommerce는 간단한 페이지에서 ID로 제품 가격을 얻습니다.

필살기쓰세요 2021. 2. 1. 19:58

제품 ID가있는 경우이를 사용하여 제품 개체를 만들 수 있습니다.

$product = new WC_Product($product_id);

After Creating Object you can run any of WooCommerce's product methods.

$product->get_regular_price();
$product->get_sale_price();
$product->get_price();


출처
https://stackoverflow.com/questions/39920056