On This Page
The CSV file can seem confusing at first, but spend 5 minutes with it and you will understand how it works, and see the flexibility it offers.
A CSV file is best opened with a spreadsheet application. At WebShopApps we prefer OpenOffice as it will save correctly on a Mac without issue and uses UTF-8.
Some facts about CSV configuration:
- CSV tables are extensively used in our shipping extensions for creating rules
- CSV files basically define the rules under which a shipping rate will show. Each row is a rule
- If you don’t understand your shipping requirements you have little chance to make a CSV file that works. Get the requirements understood first
- A CSV configuration is only as good as the person that writes it. If you write a bad CSV file then expect bad results
- If you have no experience of spreadsheets/CSV files then go look this up first, it will help
- If you are working on a Mac please ensure you save as Windows file type, else the csv will not upload
- The shipping extension works on a “best match” basis. This means it will look for the tightest match first, and then work backwards if none can be found. If you have two rows in the table, one with country code “US” and one with “*”, then a customer from the US will match on the US row and a customer from UK will match on the “*” row.
How to Upload a CSV File
- Navigate to your Extension Configuration panel under
Store Viewto be
Main Websiteor the WebSite you wish to upload to in the case of multiple stores
- You should now see an import button box appear with a browse box
- Browse for your CSV file you have setup (or use an example)
- Save Config to import the table. Any errors in the CSV will be reported here
- You should then see the appropriate shipping rates appear on the front end upon checkout
How to Export a CSV File
CSV files from Matrixrates are exported directly from the
webshopapps_matrixrate database table.
Follow the above steps for Importing and you will also see an “Export” option, just above the “Import” option.
Exporting The CSV via phpMyAdmin
Alternatively, if the solution above is not appropriate, you can export the raw shipping data using phpMyAdmin. This data has been manipulated to get into the database so bear in mind that you will need to translate it back into a CSV importable format.
- Find the table called
webshopapps_matrixrate and click on it
- Select the export tab at the top of the page
- Select the export as CSV option
- Export the csv
- Remove the columns “pk”, “website” and “cost” from the CSV file
- If applicable change the region codes back to region names (per the
- If there is a “0” (zero) in the region column you need to delete this as Magento will see it as an invalid code when uploading
- Check the csv columns match the template csv for your extension
You should end up with a CSV file similar in layout to the screenshot below: