Solution for : How to display Woocommerce product price by ID number on a custom page?
If you have the product's ID you can use that to create a product object:
$_product = wc_get_product( $product_id );
Then from the object you can run any of WooCommerce's product methods.
$_product->get_regular_price(); $_product->get_sale_price(); $_product->get_price();
No comments:
Post a Comment