How to get the regular price and sale price in woocommerce?

Woocommerce-Theme-.png

IN WordPress platform the Woocommerce is the best platform that used for an eCommerce solution.

Sale price and regular price are just meta keys.

we can easily get the prices by using following code:

Regular Price

$regular_price = get_post_meta( get_the_ID(), '_regular_price', true);

Sale Price

$sale_price = get_post_meta( get_the_ID(), '_sale_price', true);

That's it...

Read: WordPress Interview Questions and Answers