How to get Woocommerce Product Title, Description, Price etc using Product ID

How to get Woocommerce Product Title, Description, Price etc using Product ID

If you have a product id and you want to get the details of that product such as Regular Price, Sale Price, Description, Excerpt etc then you can use following code.

 

<?php

$product_id = 160;

$_product = wc_get_product($product_id);

echo $_product->get_name().”<br>”;

echo $_product->get_catalog_visibility().”<br>”;

echo $_product->get_description().”<br>”;

echo $_product->get_regular_price().”<br>”;

?>

 

Please watch the video to understand how to do it.

1 thought on “How to get Woocommerce Product Title, Description, Price etc using Product ID”

  1. Pingback: How to get woocommerce product title, description, price etc using Product ID | Nikkies Tutorials

Leave a Comment