<p>Folks:</p>
<p>I've got a multi-currency store. The user can switch their currency using a drop-down menu. In the drop-down menu, I display the currency they are using with:</p>
<pre><code>{% if cart.paymentCurrency == 'CAD' %}CAD{% endif %}
{% if cart.paymentCurrency == 'USD' %}USD{% endif %}
</code></pre>
<p>All works just fine.</p>
<p>On the same page, I want to display &quot;US$&quot; next to prices that are in US dollars. I tried the same code as above but I get nothing. Just the $ symbol. I tried:</p>
<p><code>{% if cart.paymentCurrency == 'USD' %} USD{% endif %}{% for variant in relatedProduct.variants %}{{ variant.salePrice|commerceCurrency(cart.paymentCurrency,convert=true) }}{% endfor %}</code></p>
<p>and</p>
<p><code>{% for variant in relatedProduct.variants %}{% if cart.paymentCurrency == 'USD' %} USD{% endif %}{{ variant.salePrice|commerceCurrency(cart.paymentCurrency,convert=true) }}{% endfor %}</code></p>
<p>Nothing for either.</p>
<p>Any help would be great.</p>

CC BY-SA 4.0
2021-12-09T22:40:50.820Z
I am unable to replicate this issue with the latest version of Craft and Commerce. Is everything up to date? Is the payment currency definitely set to the currency you are expecting?
nfourtythree
CC BY-SA 4.0
2021-12-10T00:06:18.143Z
It seems that the code IS correct but was not working for whatever reason. I tried again and all is well.
Wonko
<plugin-craftcommerce>
Displaying paymentCurrency
# Displaying paymentCurrency

(Asked by: username_0 on 2021-12-07)

Folks:
I've got a multi-currency store. The user can switch their currency using a drop-down menu. In the drop-down menu, I display the currency they are using with:
{% if cart.paymentCurrency == 'CAD' %}CAD{% endif %}
{% if cart.paymentCurrency == 'USD' %}USD{% endif %}

All works just fine.
On the same page, I want to display "US$" next to prices that are in US dollars. I tried the same code as above but I get nothing. Just the $ symbol. I tried:
{% if cart.paymentCurrency == 'USD' %} USD{% endif %}{% for variant in relatedProduct.variants %}{{ variant.salePrice|commerceCurrency(cart.paymentCurrency,convert=true) }}{% endfor %}
and
{% for variant in relatedProduct.variants %}{% if cart.paymentCurrency == 'USD' %} USD{% endif %}{{ variant.salePrice|commerceCurrency(cart.paymentCurrency,convert=true) }}{% endfor %}
Nothing for either.
Any help would be great.

**Tags:** plugin-craftcommerce

> **Comments:**
> **username_1**: I am unable to replicate this issue with the latest version of Craft and Commerce. Is everything up to date? Is the payment currency definitely set to the currency you are expecting?  
> **username_0**: It seems that the code IS correct but was not working for whatever reason. I tried again and all is well.  

---

## 0 answers

