Helpcenter +918010117117 https://help.storehippo.com/s/573db3149f0d58741f0cc63b/ms.settings/5256837ccc4abf1d39000001/57614ef64256dc6851749879-480x480.png" [email protected] https://www.facebook.com/StoreHippohttps://twitter.com/StoreHippohttps://www.linkedin.com/company/hippoinnovations/https://plus.google.com/+Storehippo/posts
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India

ms.currencies

This widget is used to manage the currencies of the store. Here you can get the list of all the currencies activated in your store and apply one of the currencies in the store.


Variables

currencies
It provides the list of all the currencies enabled in the store from admin panel.
name Return the name of the currency.
symbol Returns the symbol of the currency.

Methods

setCurrency This is used to apply or change the currency on your store from the storefront. You need to pass selected currency object here as an argument.

Examples

Show currency dropdown (vuejs themes)

<div v-if="ms.settings.currencies.length > 1">
    <div class="currency-dropdown dropdown"> 
        <span role="button" data-bs-toggle="dropdown">
            <span class="currency-flag me-2" :class="'currency-flag-'+ms.user.currency.name.toLowerCase()"></span>
            <span>{{ms.user.currency.name}}</span>
            <i class="bi bi-chevron-down ms-2 lh-1"></i>
        </span>
        <ul class="dropdown-menu dropdown-menu-end border-0 shadow-sm" data-bs-popper="static">
            <li class="dropdown-item py-1" v-for="currency in ms.settings.currencies">
                <span role="button" class="d-flex align-items-center" role="button" @click="ms.setPreferences({currency: currency})">
                    <span class="currency-flag me-2" style="height:20px;width:30px;background-size:100% 100%;" :class="'currency-flag-'+currency.toLowerCase()"></span>
                    {{currency}}
                </span>
            </li>
        </ul>
    </div>
</div>

Show currency dropdown (angular themes)

<span ng-if="ms.settings.currency_settings.length> 1" class="ms-pr-0" ms-widget="ms.currencies">
    <div ng-init="selected_currency = base_currency">
        <select ng-model="selected_currency" class="ms-bg-none ms-border-none"
                ng-change="setCurrency(selected_currency)"
                ng-options="currency.name for currency in  currencies">
        </select>
    </div>
</span>