Jump to content

Stuck on Currency Change Issue


Recommended Posts

Hello All,

We are using Turkish Lira (TRY) and USD on our system. The billing structure we're using have some problems about exchange rates. The prices showing under website is USD and we need to use only TRY.

So Primary must be TRY, secondary must be USD

What i did to resolve this issue and failed,

- Changed Default Currency to TRY and Secondary to USD (This caused wrong conversion to TRY) (example when i add a product on $23.99 it must convert ₺147,53 but the conversion rate is changing TRY to USD, i need USD to TRY - reverse conversion)

- Changed Cart link to Currency=1 and Currency=2 (This caused nothing, cart worked only on USD)

In this case, how can i make TRY as default Currency and make reverse conversion work (from USD to TRY)

Link to comment
Share on other sites

16 minutes ago, Safir Hosting said:

We are using Turkish Lira (TRY) and USD on our system. The billing structure we're using have some problems about exchange rates. The prices showing under website is USD and we need to use only TRY.

the quick fix for that might be to add &currency=2 for all your product buy now links (assuming 2 = TRY) on your site...

17 minutes ago, Safir Hosting said:

Changed Default Currency to TRY and Secondary to USD (This caused wrong conversion to TRY) (example when i add a product on $23.99 it must convert ₺147,53 but the conversion rate is changing TRY to USD, i need USD to TRY - reverse conversion)

note the warning at the top of the help page about changing default currencies...

Quote

Only change the default currency if you don’t yet have any invoice or transaction data in WHMCS

I assume after 3+ months of WHMCS use, you will have existing invoices.

remember that currencies are assigned to clients, not orders/invoices and so if you have made this change, a client with an existing $100 invoice when viewing their client area today, will now see the invoice as ₺100 (or vice versa)... which is a bit of a difference!

22 minutes ago, Safir Hosting said:

Changed Cart link to Currency=1 and Currency=2 (This caused nothing, cart worked only on USD)

that should work...

e.g if you use... cart.php?a=add&pid=1&carttpl=safir -> then it should use your default currency...

whereas, if you use cart.php?a=add&pid=1&carttpl=safir&currency=2 -> then it should switch to TRY and use that...

kBDoy1P.png

at some point, you might need a hook to either completely remove the currency sidebar, or modify it to remove USD as an option, but I wouldn't do that until you've got all your links updated to pass the TRY currency.

btw - do you have any clients using USD for their currency setting ?

Link to comment
Share on other sites

1 hour ago, Safir Hosting said:

I tried currency=1 and currency=2 and seems its still not working.

that screenshot above is from your site - so passing the currency in the URL should work. 🙂

1 hour ago, Safir Hosting said:

Can i make TRY selected from sidebar and hide usd. 

yes, but that wouldn't be enough.... it would still show the products in your default currency USD) unless you change the currency in the url.

possibly you could force redirection in the cart if it's not currently using your preferred currency.

Edited by brian!
Link to comment
Share on other sites

  • 1 month later...

Hi

Received the below from support.  To change default currency.  Can you please be of assistance what to add to have the default currency set when  client is not logged on?

Basiclly when the client select store/product it should show default currency 2.

 

<?php

use WHMCS\Session;

add_hook('ClientAreaPageCart', 1, function($vars) {
    // Provide your new default currency ID
    $currencyId = 2;

    if (!Session::get('uid') && !Session::get('currency')) {
        Session::set('currency', $currencyId);
    }
});

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated