{"id":14968686,"url":"https://github.com/valicm/commerce_currency_resolver","last_synced_at":"2025-10-26T05:30:36.962Z","repository":{"id":72462246,"uuid":"129924327","full_name":"valicm/commerce_currency_resolver","owner":"valicm","description":"Drupal 8 Commerce multi currency module","archived":false,"fork":false,"pushed_at":"2023-10-14T11:09:10.000Z","size":222,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"2.0.x","last_synced_at":"2025-02-05T20:10:46.480Z","etag":null,"topics":["currency","drupal","drupal-commerce","drupal-module","drupal8","multi-currency"],"latest_commit_sha":null,"homepage":"https://www.drupal.org/project/commerce_currency_resolver","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valicm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-17T15:18:34.000Z","updated_at":"2022-09-17T19:00:11.000Z","dependencies_parsed_at":"2023-10-15T11:07:56.372Z","dependency_job_id":null,"html_url":"https://github.com/valicm/commerce_currency_resolver","commit_stats":{"total_commits":176,"total_committers":20,"mean_commits":8.8,"dds":"0.34659090909090906","last_synced_commit":"307ce0130e484100f8045ebaaa86bba0290a5366"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valicm%2Fcommerce_currency_resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valicm%2Fcommerce_currency_resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valicm%2Fcommerce_currency_resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valicm%2Fcommerce_currency_resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valicm","download_url":"https://codeload.github.com/valicm/commerce_currency_resolver/tar.gz/refs/heads/2.0.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238264672,"owners_count":19443388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["currency","drupal","drupal-commerce","drupal-module","drupal8","multi-currency"],"created_at":"2024-09-24T13:40:24.261Z","updated_at":"2025-10-26T05:30:36.953Z","avatar_url":"https://github.com/valicm.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"CONTENTS OF THIS FILE\n---------------------\n\n* Introduction\n* Requirements\n* Installation\n* Submodules\n* Configuration\n* Price setup\n* Setup examples\n* Exchange rates\n* Maintainers\n\n\nINTRODUCTION\n------------\n\nEnhancement for handling multi-currency in Drupal 8 for Drupal Commerce.\n\nDrupal Commerce 3 supports multiple currencies out of the box.\n\nCommerce currency resolver tries to solve resolving prices per currency,\ncalculating those prices and exchange rates between different currencies.\n\n\nREQUIREMENTS\n------------\n\nThis module requires Drupal Commerce 3, and it's submodule price.\nThe additionally submodules have different requirements.\n\n\nINSTALLATION\n------------\n\nInstall the Commerce Currency Resolver module as you would normally install\nany Drupal contrib module.\nVisit https://www.drupal.org/node/1897420 for further information.\n\n\nSUBMODULES\n------------\n\nThe module comes with six different submodules.\n\n  | Name      | Description                                                                                             |\n  |-----------|---------------------------------------------------------------------------------------------------------|\n  | language  | Resolving currency per user language, and UI to map languages to specify currency.                      |\n  | geoip     | Resolving currency per use geo country via GeoIP module, and UI to map language to specify currency.    |\n  | smart_ip  | Resolving currency per use geo country via Smart IP module, and UI to map language to specify currency. |\n  | cookie    | Resolving currency via cookie, providing a block for selecting desired currency.                        |\n  | exchanger | Integration with Commerce Exchanger, adds feature to auto-calculate all prices based of exchange rate   |\n  | shipping  | Integration with Commerce Shipping module for use with Commerce exchanger                               |\n\nCONFIGURATION\n--------------\n\n    1. Navigate to Administration \u003e Extend and enable the Commerce Currency\n       Resolver module.\n    2. Navigate to Home \u003e Administration \u003e Commerce \u003e Configuration\n                   \u003e Currency resolver.\n    3. Enable one of the provided submodules if needed.\n\nThe main module by default follows Commerce Core 3 logic where currency is resolved via\ncurrent resolved Store.\n\nThe submodules listed above provide different options to resolve price and calculate or convert prices\nmore dynamically for products, orders, promotions, fees, taxes, custom adjustments.\n\nPRICE SETUP\n--------------\n    1. Price per currency - you can specify now in module settings field prefixes for each currency field\n    2. Combo mode - once the exchanger module is enable, this is default way of working.\n    3. Automatic - once the exchanger module is enabled you can do everything automatic.\n\nCurrently, the module does not support price list module.\n\nSETUP EXAMPLES\n--------------\nHere are few examples of possible configuration and examples.\nIf you are resolving currencies per current store, and you did set up everything per currency,\nyou really don't need than this module.\n\n| Resolve type | Handling currency                                                           | Do I need this module?            |\n|--------------|-----------------------------------------------------------------------------|-----------------------------------|\n| store        | Products have specific prices. Promotion and shipments are set per currency | NO                                |\n| language     | Same as previous example.                                                   | Language submodule                |\n| language     | Same as previous example plus custom adjustments                            | Language and exchanger submodule  |\n| any          | Want to not care about specific setup of promotions, fees, shipping methods | Exchanger submodule for auto mode |\n| any          | Using commerce shipping and run automatic conversion                        | Shipping and exchanger submodule  |\n\n\nCACHING\n--------------\nCurrency resolver module works with \"**Internal Dynamic Page Cache**\" only.\n\n**Page Cache** module needs to be disabled.\n\nThe Drupal core Page Cache module does not work with personalized \"content\".\nDynamic Page Cache is built for that purpose.\n\nExplanation - https://www.drupal.org/project/commerce_currency_resolver/issues/3042307#comment-13046326\n\n\nEXCHANGE RATES\n--------------\n\nHandle through Commerce Exchanger module\nhttps://www.drupal.org/project/commerce_exchanger\n\nCOMMERCE SHIPPING\n--------------\n\nIf you are using commerce shipping, there are two options for how shipping methods\ncan be set to work with currency resolver.\n\n* If you are using condition _Order currency_ and the selected currency matches to the price currency selected\n  under _Rate amount_ then you don't need to do anything.\n* If you need to auto-calculate price or have multiple prices per shipping method,\n* you need to enable submodule _commerce_currency_resolver_shipping_.\n\n\nEXAMPLES\n-----------\n\n### Adding order item programmatically\nIf you are adding order items programmatically in your code,\nyou need to take in an account possible conflicts with prices. To avoid that\nis best that you're using resolver to resolve prices for certain items in the cart.\n\nThe example below shows an entire process custom \"add to cart\" process, where we add\nitem to the cart.\n\n```\n**\n@var \\Drupal\\commerce_cart\\CartManagerInterface $cart_manager */\n$cart_manager = \\Drupal::service('commerce_cart.cart_manager');\n\n/** @var \\Drupal\\commerce_order\\Resolver\\OrderTypeResolverInterface $order_type_resolver */\n$order_type_resolver = \\Drupal::service('commerce_order.chain_order_type_resolver');\n\n/** @var \\Drupal\\commerce_store\\CurrentStoreInterface $current_store */\n$current_store = \\Drupal::service('commerce_store.current_store');\n\n/** @var \\Drupal\\commerce_cart\\CartProviderInterface $cart_provider */\n$cart_provider = \\Drupal::service('commerce_cart.cart_provider');\n\n/** @var \\Drupal\\commerce_order\\OrderItemStorage $order_item_storage */\n$order_item_storage = \\Drupal::service('entity_type.manager')-\u003egetStorage('commerce_order_item');\n$store = $current_store-\u003egetStore();\n\n$context = $context = new Context(\\Drupal::currentUser(), $store);\n$resolved_price = \\Drupal::service('commerce_currency_resolver.price_resolver')-\u003eresolve($product, 1, $context);\n$order_item = $order_item_storage-\u003ecreateFromPurchasableEntity($product, ['unit_price' =\u003e $resolved_price]);\n\n$order_type_id = $order_type_resolver-\u003eresolve($order_item);\n\n$cart = $cart_provider-\u003egetCart($order_type_id, $store);\nif (!$cart) {\n  $cart = $cart_provider-\u003ecreateCart($order_type_id, $store);\n}\n\n$cart_manager-\u003eaddOrderItem($cart, $order_item);\n```\n\nMAINTAINERS\n-----------\n\nThe 8.x-1.x branch was created by:\n\n * Valentino Medimorec (valic) - https://www.drupal.org/u/valic\n\nThis module was created and sponsored by Foreo,\nSwedish multinational beauty brand.\n\n * Foreo - https://www.foreo.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalicm%2Fcommerce_currency_resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalicm%2Fcommerce_currency_resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalicm%2Fcommerce_currency_resolver/lists"}