The message indicates that some product prices were written incorrectly to the database, and it's is usually caused by a CSV import/export plugin. 

The currency prices are stored in a specific format in the database (it's a JSON structure), and, while import/export plugins can read and export such data, they tend to break it 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.


To make an example, here's how the data is transformed by the CSV import/export plugin.


Export

Data to export (database): {"EUR":"100", "USD":"200"}

Exported data (CSV): {"EUR":"100", "USD":"200"}


Import

 

Data to import (CSV): {"EUR":"100", "USD":"200"}

Imported data (database): a:2:{s:3:"EUR";s:3:"100";s:3:"USD";s:3:"200";}


The imported data is no longer in the correct format, so the Currency Switcher cannot use it and triggers the warning.


How to check the data in the database

You can check the data stored in your database 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:2:{s:3:"EUR";s:3:"100";s:3:"USD";s:3:"200";}" indicated above, which is incorrect.


Solution

Fixing the issue is a simple matter of feeding the data in the correct format to the CSV Import plugin you use. Since the CSV Import plugins will manipulate JSON data, even if they 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 {"EUR":"100", "USD":"200"} to "{\"EUR\":\"100\", \"USD\":\"200\"}" in the CSV file to import and see if it works. That's the most common format that yields the correct format. Once you find the correct format, you can apply it to all the 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.


Should you need assistance with the import, we can help you configuring it as part of our consultation service. If you wish to avail of such service, please feel free to contact us.


You can purchase the Currency Switcher from our online shop.