How do we change currency?

Discussion in 'aMember Pro v.4' started by menykort, Oct 1, 2012.

  1. menykort

    menykort New Member

    Joined:
    Aug 17, 2012
    Messages:
    2
    I read that in order to change currency we need to delete all invoices. How do we do that? Are there any other ways to change the base currency?

    /Magnus
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    In fact, that is not necessary to delete all invoices.
    You can edit file
    amember/library/Am/Form/Standard.php
    and replace lines
    Code:
            if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice"))
                $currency->toggleFrozen(true);
    to
    Code:
    //        if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice"))
    //            $currency->toggleFrozen(true);
    then edit box will be unlocked and you will be able to change currency. It is blocked as changing currency in live system may (and will) have weak side effects. However, if your system has nothing but few test invoices, it is not a problem at all.
  3. miso

    miso aMember Pro Customer

    Joined:
    Aug 22, 2006
    Messages:
    543
    what effect does that have on invoices though, in case it's done on a live site?

    for example, I had amember set to one currency, imported all the users/invoices from v3, then I realized I needed to change the currency to the correct one.

    catastrophic consequences?
  4. david_hunt

    david_hunt aMember Pro Customer

    Joined:
    Jan 1, 2013
    Messages:
    32
    I am in Version 4.0 I do not see a Standard.php file in the directory amember/library/Am/Form/

    even dropping one in has no effect,
  5. david_hunt

    david_hunt aMember Pro Customer

    Joined:
    Jan 1, 2013
    Messages:
    32
    Ahh it looks like this has moved to

    amember/library/Am/Form/Setup/Standard.php

    am I wrong?
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes correct.
  7. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    50
    I'm not sure that commenting out the lines works so much in the later versions... however, changing the code from 'true' to 'false' works - you can then reset the base currency and then revert back to 'true'.

    Change this:

    Code:
            if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice")) {
                $currency->toggleFrozen(true);
    To this:

    Code:
            if (Am_Di::getInstance()->db->selectCell("SELECT COUNT(*) FROM ?_invoice")) {
                $currency->toggleFrozen(false);
    Then make your currency change, and then revert back.

Share This Page