I've got an ACF Advanced custom field for currency where the user can select currency from the available USD, GBP & EUR select dropdown.
Based on the selection I want to show the currency sign.
I'm trying to define the $price_currency variable that I can then use in my output echo like this: echo '<span>' . $price_currency . '</span>';
This is my current code:
$price_currency = {
if(get_field('ktrr_ktcamp_price') == "USD");
echo '$';
} elseif(get_field('ktrr_ktcamp_price') == "GBP");
echo '£';
} elseif(get_field('ktrr_ktcamp_price') == "EUR");
echo '€';
}
But I'm getting syntax errors.
What am I doing wrong here?
Aucun commentaire:
Enregistrer un commentaire