1

I need, when user currency change this time automatically price change the related with the active current.

<h4 class="h5">Starting At<strong>
{if  $currency=2 } // currency id = 2//
 Rs 1.19                                        
 {else}
 $ 1.19
{/if}
<small>/m</small></strong></h4>

I try this code. but not work. :( please help me

susanto
  • 57
  • 10

2 Answers2

2

WHMCS doesn't load current currency on all pages, i think only cart pages.

So you need to add a currency selection form to allow client to switch between currencies.

<form action="" method="post">
    <label for="currency_sel">Currency:</label>
    <select name="currency" id="currency_sel" class="form-control" onchange="submit();">
        <option value="1" {if $smarty.post.currency eq '1'}selected{/if}>$</option>
        <option value="2" {if $smarty.post.currency eq '2'}selected{/if}>Rs</option>
    </select>   

</form>

The selected currency will be available with the variable $smarty.post.currency Update your code as following:

<h4 class="h5">Starting At<strong>
{if  $smarty.post.currency eq '2' } 
 Rs 1.19                                        
 {else}
 $ 1.19
{/if}
<small>/m</small></strong></h4>
wesamly
  • 1,484
  • 1
  • 16
  • 23
-1

Use this 100% working

 {if  $activeCurrency.id > 1 }
    $0.60
    {else}
    ₹45
    {/if}