- Put files in
./import/[date].csv
- Update the date in
settings.json
to correspond to the file in the import directory - Run
source bin/activate
- Run
python orders.py
- Exported file will be created in
./export/[date]
directory - If you want
-1
appended to order numbers, setaddons
parameter totrue
insettings.json
- If there are issues with the export, the terminal will flag error messages and log them to an error file in the export directory.
- The following errors are logged, and they do not prevent the export from being created:
- For U.S. and Canada, state value is longer than two characters.
- Postal code is longer than 11 characters.
- Postal code contains characters other than alphanumeric characters or dashes.
- Country code is not included in international shipping dictionary.
- Once done, run
deactivate
- Create directory and set up virtual environment:
python3 -m venv .
- Activate environment:
source bin/activate
- Deactivate environment when done:
deactivate
Copy settings.example.json
to settings.json
.
In the Terminal, while in this directory:
git fetch
git pull
Set in settings.json
.
String. Corresponds to a filename in ./import/
and then creates a directory and file in ./export/
. Suggested formats are 20210601
and 20210601-1
, but any format works.
Boolean. When true
, appends -1
to all order numbers in the exported file.
String. Indicates if the imported file came from CROWDOX
or BACKERKIT
.
Found in orders.py
.
Dictionary. Legacy for mapping common invalid state names for Fosdick import. Shouldn't be needed.
Dictionary. Maps SKUs to base prices and shipping rates. Each SKU corresponds to a list where the first value is the base price, and the second value is the base shipping rate.
Dictionary. Maps country codes to base shipping rates. This value replaces the shipping rate for each line item when calculating shipping.