How To Check If Product Is On Sale By Product ID (WooCommerce)

To check if the product is on sale by using the product id: Get product object using product id => ($product = wc_get_product($id);) Get sale price of product => ($sale_price = $product->get_sale_price();) Lastly, get the price of product => ($price = $product->get_price();) Conclusion: get_price() method return the current active price. So, if the sale is […]