Skip to main content
deleted 1 character in body
Source Link
Thony
  • 383
  • 3
  • 11

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternalexternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products types you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules that convert a price in USD if the user IP is from the US:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices (use the price field four your default currency, and the dedicated fields for the others).

You may use the debug mode in /admin/config/people/smart_ip to make tests.

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products types you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices (use the price field four your default currency, and the dedicated fields for the others).

You may use the debug mode in /admin/config/people/smart_ip to make tests.

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip external service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products types you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules that convert a price in USD if the user IP is from the US:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices (use the price field four your default currency, and the dedicated fields for the others).

You may use the debug mode in /admin/config/people/smart_ip to make tests.

added 94 characters in body
Source Link
Thony
  • 383
  • 3
  • 11

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products types you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices (use the price field four your default currency, and the dedicated fields for the others). 

You canmay use the debug mode in /admin/config/people/smart_ip to make tests.

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices. You can use the debug mode in /admin/config/people/smart_ip to make tests.

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products types you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices (use the price field four your default currency, and the dedicated fields for the others). 

You may use the debug mode in /admin/config/people/smart_ip to make tests.

Source Link
Thony
  • 383
  • 3
  • 11

Yes you can do it with modules, I did.

Using a conbination of rules, commerce_multicurrency https://www.drupal.org/project/commerce_multicurrency and smartip https://www.drupal.org/project/smart_ip.

  1. Activate the modules.

  2. Configure smart_ip exeternal service in /admin/config/people/smart_ip FYI https://IPInfoDB.com free version worked right away for me (you need to register and get an API key though).

  3. Go to /admin/commerce/config/currency choose your default currency and activate the currencies you need.

  4. Got to /admin/commerce/config/currency/handling add the currencies you want to the products you want (but don't add the default currency).

  5. Now to /admin/commerce/config/product-pricing you need to create the rules that will convert the price for each currencies. Here is an exported example rules:

    { "rules_set_price_in_usd" : { "LABEL" : "Set price in USD", "PLUGIN" : "reaction rule", "OWNER" : "rules", "TAGS" : [ "price conversion" ], "REQUIRES" : [ "smart_ip", "commerce_multicurrency", "rules", "commerce_product_reference" ], "ON" : { "commerce_product_calculate_sell_price" : [] }, "IF" : [ { "smart_ip_condition_in_country" : { "country" : { "value" : { "US" : "US" } } } } ], "DO" : [ { "commerce_multicurrency_set_user_currency_code" : { "currency_code" : "USD" } }, { "component_commerce_multicurrency_use_usd" : { "commerce_line_item" : [ "commerce_line_item" ] } } ] } }

Once the rules for each currencies have been established, you only have to go to each products and enter the prices. You can use the debug mode in /admin/config/people/smart_ip to make tests.