Import Export
Import & Export
Measurement Price Calculator supports two methods for moving calculator settings between products and sites: JSON import/export for individual products and WooCommerce CSV for bulk operations.
JSON import/export
Exporting settings
- Go to the Measurement tab on any product that has a calculator configured.
- Scroll to the bottom of the tab to find the Import/Export section.
- Click Download Settings (JSON).
- A JSON file downloads to your computer named
mpwc-settings-{product-id}.json.
What's included in the export
The JSON file contains:
| Data | Included |
|---|---|
| Calculator type | Yes |
| Pricing unit, label, minimum price, overage | Yes |
| Custom variables (names, labels, units, min/max, input types, options) | Yes |
| Custom formula expression | Yes |
| Pricing rules (all tiers with regular price, sale price, date ranges) | Yes |
| Conditional logic rules | Yes |
| Variation settings (for variable products) | Yes |
| Plugin version | Yes (for compatibility checking) |
Scroll to see all columns →
What's not included
| Data | Reason |
|---|---|
| Product name, description, images | These are standard WooCommerce product fields |
| Regular price | Set independently in the General tab |
| Inventory settings | Managed through WooCommerce stock management |
Scroll to see all columns →
Importing settings
- Go to the Measurement tab on the product you want to configure.
- Scroll to the Import/Export section.
- Click Choose File and select a previously exported JSON file.
- Click Import Settings.
- The settings are applied to the product. Review them and click Update to save.
Import behaviour
- Importing replaces all existing calculator settings on the target product.
- The product must be saved (click Update) after importing for changes to take effect.
- The import validates the file format and shows an error if the file is invalid or corrupt.
- Version checking ensures forward compatibility. Files from the same or older plugin version are always compatible.
Use cases for JSON import/export
- Copy settings between products - Export from one product, import to another.
- Move settings between sites - Export from staging, import to production.
- Backup settings - Download a JSON backup before making changes.
- Share configurations - Send a JSON file to another store owner.
WooCommerce CSV support
The plugin integrates with WooCommerce's built-in CSV import and export for bulk operations.
Exporting via CSV
- Go to Products → All Products.
- Click Export at the top.
- In the export options, the plugin adds calculator-related columns automatically.
- Click Generate CSV.
CSV columns
The following columns are added to the WooCommerce CSV export:
| Column | Content |
|---|---|
mpwc_calculator_settings | JSON-encoded calculator settings |
mpwc_pricing_rules | JSON-encoded pricing rules |
Scroll to see all columns →
These columns contain the same data as the JSON export but embedded as JSON strings within the CSV.
Importing via CSV
- Go to Products → All Products.
- Click Import at the top.
- Upload your CSV file.
- The plugin automatically maps the
mpwc_calculator_settingsandmpwc_pricing_rulescolumns. - Complete the import wizard.
CSV import behaviour
- Products matched by ID or SKU receive the calculator settings from the CSV.
- The imported JSON is validated and sanitized through the same pipeline as the admin form.
- If a row's calculator data is empty or invalid, the product's existing settings are preserved.
- Updating existing products preserves calculator settings that aren't in the CSV (partial update).
Use cases for CSV
- Bulk product updates - Update calculator settings for hundreds of products at once.
- Site migration - Move entire product catalogs with calculator settings intact.
- Spreadsheet management - Edit calculator settings in a spreadsheet and re-import.
Copying settings between products
The fastest way to copy settings from one product to another:
- Open the source product's Measurement tab.
- Click Download Settings (JSON).
- Open the target product's Measurement tab.
- Click Choose File, select the downloaded JSON file.
- Click Import Settings.
- Click Update to save.
File format reference
The JSON export file structure:
{
"version": "1.0.0",
"calculator_type": "area",
"settings": {
"pricing_unit": "sq ft",
"pricing_label": "per sq ft",
"minimum_price": "50",
"overage": "10"
},
"variables": [...],
"formula": "",
"pricing_rules": [...],
"conditions": [...],
"variation_settings": {...}
}
Important: Do not manually edit JSON files unless you understand the format. Invalid JSON will be rejected on import.
Best practices
- Export before making changes. Keep a backup of working settings.
- Use JSON for individual products. It's faster and more precise.
- Use CSV for bulk operations. When updating many products at once.
- Test imports on a staging site first. Verify settings are correct before importing to production.
- Keep exported files organized. Name files descriptively (e.g.,
hardwood-flooring-settings.json).
Troubleshooting
JSON import fails
- Verify the file is valid JSON (open in a text editor and check for syntax errors).
- Make sure the file was exported from the same plugin (not a different measurement plugin).
- Check the file isn't empty or corrupt.
CSV import missing calculator data
- Verify the CSV contains the
mpwc_calculator_settingscolumn. - Check that the column mapping step correctly identifies the calculator columns.
- If the JSON in the CSV cell is malformed, that row's settings will be skipped.
Settings not applying after import
- Make sure you clicked Update to save the product after importing.
- Refresh the product editor page to see the imported settings.
- Clear any caching plugins if the frontend doesn't reflect changes.