·
Added a discussion

how add more Currency sign in payment modules.  una have table in database only Currency code

  • 1102
Comments
    • Hello

      Currently, to add new currency you need to update database setting 'bx_payment_default_currency_code' in 'sys_options' table adding necessary currency code in the list which is stored in 'extra' field. Then you need to modify $_aCurrencies field in BxBaseModPaymentConfig class, which can be found in modules/base/payment/classes/BxBaseModPaymentConfig.php file. You need to add association between currency code and currency sign there .

      • thank you so much

        • Hello Anton!

          pls this guide also applies to UNA version 13.0.0?or it is enough if I edit, for example, YEN(which I do not use) to Czech CZK and Currency sign to Kč?In settings-general i see Currency code CZK which I created according to the instructions https://una.io/cmts-view/avfdil?sys=bx_forum&cmt_id=38163 But in Payments-Currency there is no CZK.I use PayPal payment provider, which supports the Czech currency.

          Thx Pavel

          • how to modify this for CZK?

            $aCurrencies = BxDolForm::getDataItems($this->CNF['OBJECT_FORM_PRELISTS_CURRENCIES'], false, BX_DATA_VALUES_ADDITIONAL);

                    if(!isset($aCurrencies[$sCode]))

                        return '';

                    return $aCurrencies[$sCode];

            • Hello. Currently (in case of UNA 13) currencies are stored in the DB. So, you need to execute the following queries:

              For Core:

              INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`, `Data`) VALUES
              ('Currency', 'CZK', 1, '__CZK', '', 'a:1:{s:4:"sign";s:6:"A$";}');
              

              Don't forget to correctly change serialized currency code in the last Data field and add translation for __CZK via Studio -> Polyglot.

              For Payments module

              INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES 
              ('bx_payment_currencies', 'CZK', 7, 'CZK', 'code_for_CZK_like_$_for_USD');
              
              • Hello Anton!

                well that's a great guide 👍 .. thank you very much

                Login or Join to comment.