<p>According to <a href="https://craftcms.com/docs/commerce/3.x/orders-carts.html" rel="nofollow noreferrer">the documentation</a>, carts are represented by the <a href="https://docs.craftcms.com/commerce/api/v3/craft-commerce-elements-order.html" rel="nofollow noreferrer">craft\commerce\elements\Order</a> class. The <a href="https://docs.craftcms.com/commerce/api/v3/" rel="nofollow noreferrer">API documentation</a> is a useful way of finding available methods and properties. In this case, <a href="https://docs.craftcms.com/commerce/api/v3/craft-commerce-elements-order.html#method-setpaymentcurrency" rel="nofollow noreferrer">Order::setPaymentCurrency</a> seems to be what you're looking for. So this should work:</p>
<pre><code>{% if cart.shippingAddress.countryId == '38' %}
  {% do cart.setPaymentCurrency('CAD') %}
{% endif %}
</code></pre>

CC BY-SA 4.0
2021-08-13T22:05:31.113Z
Amazing. Thanks!
Document Services
CC BY-SA 4.0
2021-08-14T18:59:55.420Z
This seems to be working now just fine (after removing COMMERCE_PAYMENT_CURRENCY in my index file) and setting the paymentCurrency POST variable in my /pay form.

BUT -- any way to have the backend reflect the currencies actually charged? It seems to always show the store default on the order screen...
Document Services
CC BY-SA 4.0
2021-08-16T07:53:07.107Z
@DocumentServices Not sure about that, sorry. Maybe post that as a new question!
MoritzLost
CC BY-SA 4.0
2021-08-13T07:53:24.050Z
2021-08-13T07:53:24.050Z
MoritzLost
<p>Is it possible to manually set the currency during the checkout process? Right now Im trying the following (set currency to CAD for Canadian buyers), which seems to break the cart array....</p>
<pre><code>{% if cart.shippingAddress.countryId == '38' %}
  {% set cart = cart|merge({'paymentCurrency': 'CAD'}) %}
{% endif %}
</code></pre>

<plugin-craftcommerce>
Manually Set Craft Commerce Currency
# Manually Set Craft Commerce Currency

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

Is it possible to manually set the currency during the checkout process? Right now Im trying the following (set currency to CAD for Canadian buyers), which seems to break the cart array....
{% if cart.shippingAddress.countryId == '38' %}
  {% set cart = cart|merge({'paymentCurrency': 'CAD'}) %}
{% endif %}

**Tags:** plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2021-08-13. Score: 2

According to the documentation, carts are represented by the craft\commerce\elements\Order class. The API documentation is a useful way of finding available methods and properties. In this case, Order::setPaymentCurrency seems to be what you're looking for. So this should work:
{% if cart.shippingAddress.countryId == '38' %}
  {% do cart.setPaymentCurrency('CAD') %}
{% endif %}

> **Comments:**
> **username_0**: Amazing. Thanks!  
> **username_0**: This seems to be working now just fine (after removing COMMERCE_PAYMENT_CURRENCY in my index file) and setting the paymentCurrency POST variable in my /pay form.  BUT -- any way to have the backend reflect the currencies actually charged? It seems to always show the store default on the order screen...  
> **username_1**: @DocumentServices Not sure about that, sorry. Maybe post that as a new question!  

---

