Child pages
  • [in-commerce] Currency converter code reorganization
Skip to end of metadata
Go to start of metadata

Imported From:

All currency converter classes are located in same file, not in separate files as they should. Base currency converter class is named "kCurrencyRates" (starting with "k"), but it is not part of In-Portal distribution, and belongs to In-Commerce module, so "k" should be removed.

Also this class is registered not in unit config, but in kApplication class directly. At the end all classes from file "\in-commerce\units\currencies\currency_rates.php" should be moved to "\in-commerce\units\helpers" folder and named properly, because they are actually helpers.

Related Tasks

MINC-39 - Getting issue details... STATUS


  1. Yes, I agree with Alex.

    However do we really want to create 3 separate files for each CurrencyRates
    class which only has 2 methods in each?

    What if we properly rename and move kCurrencyRates as proposed into helpers
    and create a separate file for all kBankLVCurrencyRates, kECBCurrencyRates,
    kFRNYCurrencyRates which extend kCurrencyRates?

    What's you take on this?


  2. In case if we don't move each class declaration to separate file, then we
    will violate our own coding standards, but because of they are really small,
    then we could keep them together as you proposed.

  3. Yes, they are super-small so I think we can do a single file in this

    The question remains where do we put them? They will be kind of
    extensions of that Currency Helper once refactored.

    What you think?


  4. Did you miss my original post, where I've mentioned place, where those
    classes should be moved. In that case it will be

  5. Ok so you recommend we leave all classes in a single file. I thought to
    break it on two files - Base Currency Converter class and separate file for
    Extension classes...

    I am okay with a single file - it was just a thought.


  6. Here is a task for this:

    572: Refactor Currency Converter Class

    MINC-39 - Getting issue details... STATUS


  7. Hi guys,

    I'd ask a question: how many e-commerce projects had more than 1
    currency enabled?

    I don't know how much theses 175 currencies weight in DB, but if it
    could fasten order process, I'd recommend a function to remove
    unecessary currencies.


  8. Hi Phil,

    Not to disappoint you, but I know many In-Commerce projects that have

    Also, there is NO additional load (considerable) related to having all
    175 currencies - really small amount and loaded ONLY when needed.

    This task is purely for Code Standards of In-Portal.