check if product has discount code example
Example: check if product is discounted
if($product->getFinalPrice() < $product->getPrice()){
//had a discount
}
if($product->getFinalPrice() < $product->getPrice()){
//had a discount
}