Contents
On this page
WP-CLI - Plugixa Multi Currency for WooCommerce
Pro adds wp plugixa-mc commands to WP-CLI, for scripts, deployments and
cron jobs. They need the Settings backup and WP-CLI app (and Fixed prices per currency for
the prices commands) switched on in the App manager.
Currencies
wp plugixa-mc currencies
wp plugixa-mc currencies --format=json
Lists every configured currency with code, enabled, rate, margin, source, updated and
checkout. --format is table (default), csv, json or yaml.
Exchange rates
wp plugixa-mc rates update
wp plugixa-mc rates update --provider=nbp
wp plugixa-mc rates providers
| Command | What it does |
|---|---|
rates update |
Updates rates now, as Update rates now does, and prints the result for each currency. |
rates update --provider=<id> |
Asks only that provider, for example to compare sources. |
rates providers |
Lists the providers in use, with their ids. |
The same safety check applies as in the admin: currencies set to manual only are skipped, and a rate that looks wrong is refused. See Exchange rates.
Convert an amount
wp plugixa-mc convert 19.99 --to=EUR
wp plugixa-mc convert 4.90 --to=GBP --context=shipping
Converts an amount from your store currency with the same rate, margin, rounding and charm ending
as the shop. --context picks the rounding rule: price (default), shipping, fee, or raw
for the currency’s decimals only.
Fixed prices
wp plugixa-mc prices export --file=prices.csv
wp plugixa-mc prices import prices.csv --dry-run
wp plugixa-mc prices import prices.csv
Uses the same CSV format as the Fixed prices screen. import matches rows by product_id,
or by sku when the ID is empty. An empty regular or sale cell removes that price; the
sale_from and sale_to columns set the currency’s own sale dates. --dry-run checks the file
and reports, changing nothing. Skipped lines are printed as warnings with their reason. See
Fixed prices.
Settings files
wp plugixa-mc settings export --file=mc-settings.json --user=admin
wp plugixa-mc settings import mc-settings.json --dry-run --user=admin
wp plugixa-mc settings import mc-settings.json --user=admin
Exports or imports the whole configuration as one JSON file, the same file as the Settings
backup card on the Tools page. API keys and the feed key are never exported. Import adds or
updates currencies but never deletes any; --dry-run reports what the file would change.
The settings commands run as the user given with --user, who must be allowed to manage the
plugin’s settings, and every value goes through the same checks as the settings screens. See
Settings backup.
Quick Links
Share