{if file_exists("templates/$template/includes/common/overwrites/currency-dropdown.tpl")}
     {include file="./overwrites/currency-dropdown.tpl"}
{else}
    {if $templatefile|strstr:"modules/addons/LagomOrderForm"}
        {if $currentpagelinkback|strstr:"?"}
            {$currentpagelinkback = rtrim($currentpagelinkback, '&amp;')}
            {$divChar = "&amp;"}
        {else}
            {$currentpagelinkback = rtrim($currentpagelinkback, '?')}
            {$divChar = "?"}
        {/if}
    {elseif $currentUrl|strstr:"?"}
        {$currentpagelinkback = rtrim($currentpagelinkback, '&amp;')}
        {$divChar = "&amp;"}
    {else}
        {if substr($currentpagelinkback, -1) != '&'}
            {$currentpagelinkback = rtrim($currentpagelinkback, '?')}
            {$divChar = "?"}
        {/if}
    {/if}
    {if $pageType == "website" && $currentpagelinkback|strstr:"cmsid"}
        {$divChar = ""}
        {$url = "?"|explode:$currentpagelinkback}
        {$stringToReplace = ""}
        {if isset($url[1])}
            {$url2 = "&amp;"|explode:$url[1]}
            {if isset($url2[0])}
                {$stringToReplace = "`$url2[0]`"}
            {/if}
        {/if}
    {else}
        {$stringToReplace = ""}
    {/if}
    {if !$loggedin}
        <div class="dropdown-menu dropdown-menu-right">
            <div class="dropdown-menu-items has-scroll">
                {if $currencies && is_array($currencies)}
                    {foreach $currencies as $currency}
                        <div class="dropdown-menu-item {if isset($activeCurrency.id) && isset($currency.id) && $activeCurrency.id == $currency.id}active{/if}">
                            <a tabindex="0" href="{$currentpagelinkback|replace:$stringToReplace:""}{$divChar}currency={if isset($currency.id)}{$currency.id}{/if}" rel="nofollow">
                                <span>{if isset($currency.code)}{$currency.code}{/if}</span>
                            </a>
                        </div>
                    {/foreach}
                {else if isset($activeCurrency)}
                    <div class="dropdown-menu-item active">
                        <a tabindex="0" href="{$currentpagelinkback|replace:$stringToReplace:""}{$divChar}currency={if isset($activeCurrency.id)}{$activeCurrency.id}{/if}" rel="nofollow">
                            <span>{if isset($activeCurrency.code)}{$activeCurrency.code}{/if}</span>
                        </a>
                    </div>
                {/if}
            </div>                 
        </div>
        {if isset($RSThemes['addonSettings']['hover_triggered_submenu_expansion']) && $RSThemes['addonSettings']['hover_triggered_submenu_expansion'] == "enabled" && (($RSThemes.layouts.templateLayout != 'left-nav' && $RSThemes.layouts.templateLayout != 'left-nav-wide') || (isset($navtype) && $navtype == "secondary"))}
            <div class="dropdown-menu-filler"></div>
        {/if}
    {/if}
{/if}