I get this message in my browser: Parse error: syntax error, unexpected 'if' (T_IF)
I have been making a HTML table showing prices on a Woocommerce product.
I have seen a lot of similar issues, but cannot relate to my own problem.
The problem should be in this code...
<tr>
<td>'. $product_variation->get_name() .'</td>
<td>'. $product_variation->get_regular_price() .'</td>
<td>'
if($sale_price) {
echo $sale_price;
}else {
echo $product_variation->get_regular_price();
}
'</td>
</tr>';´´´