This issue is caused by the CSV import/export plugin. The currency prices are stored by the Currency Switcher in a specific format in the database (it's a JSON structure), and the import/export plugin "breaks" that format during the import. In other words, the export and import process are asymmetrical:

  • Export: prices are in JSON format. The CSV export keeps them as they are.
  • Import: prices are in the JSON format exported earlier. The CSV import process transforms the JSON in serialised PHP data, which is incompatible with the Currency Switcher.


The following example, shows how the data is transformed by the CSV import/export plugin.


Export

  • Data to export (database): {"USD":"200"}
  • Exported data (CSV): {"USD":"200"}

Import

  • Data to import (CSV): {"USD":"166"}
  • Imported data (database): a:1:{s:3:"USD";s:3:"200";}


As you can see, the imported data is no longer in the correct format, so the Currency Switcher cannot use it. If needed, you can easily check this by running the following query on your database:

SELECT *
-- Replace the "wp_" prefix with the one applicable to your site
FROM wp_postmeta PM
WHERE (PM.meta_key IN ('_regular_currency_prices', '_sale_currency_prices', 'variable_regular_currency_prices', 
'variable_sale_currency_prices')

After running the query, you should see that some of the prices are in a format that resembles the "a:1:{s:3:"USD";s:3:"200";}" indicated abovem which is incorrect.


How to fix the issue

Fixing the issue is a simple matter of feeding the data in the correct format to the CSV Import plugin you use. Since the plugin will manipulate JSON data, even if it shouldn't, it will be necessary to amend CSV file to be imported, so that the final result will be data in the correct format. You can find a couple of sample formats in our knowledge base (at the end of the article): Where are products' currency prices stored and how can I import them?


To determine which one will work, you can simply try them on a single product. For example, you could change {"USD":"200"} to "{\"USD\":\"200\"}" in the CSV file to import and see if it works. That's the most common format that yields the correct format.


Please note that you will have to do that for all rows in your CSV file (it would be more convenient if the CSV import plugin provided a way to say "don't process column X", but such option might not be available at the moment).