Skip to content

trollspank/shopify2woo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify2Woo

Convert Shopify Orders to Woo Commerce Orders. This command line tool takes an input CSV file and generates an output CSV file.

A few options exist to help "massage" the data into a more friendly WooCommerce import format.

License

Licensed under MIT License.

Disclaimer

I wrote this because I needed it, and I hand it to you to use, modify and make better. But, if it doesn't work, it's because my sample was my own store and my own problems that were encountered. Your mileage may vary.

The Initial Motivation for Shopify2Woo

I moved to WooCommerce because Shopify screwed me and shut down my payment gateway (then charged me 3% to use a third party) because they accused me of selling alcohol without a license. They wouldn't listen to reason as to why I didn't sell alcohol, so my motivation was to get onto a platform that gave me more power over my destiny, enter WooCommerce.

Now, my motivation is to make sure everyone else has the freedom to get off the platform that backstabbed me after six years on their service. So, here you go, my revenue... making it easier to get OFF their platform.

Resources

WooCommerce CSV Import Suite (allows us to import orders): https://docs.woocommerce.com/document/customer-order-csv-import-suite/

WooCommerce CSV Example Template: https://docs.google.com/spreadsheets/d/16ub-_xEJD9V5UL6d_rTQ4LLu0PT9jXJ0Ti-iirlKyuU/edit#gid=584795629

Shopify Export Orders Specification: https://help.shopify.com/en/manual/orders/export-orders

The docs directory within this repository has a few helpful tools of information, I broke out the columns/indexes for the shopify csv, woo_commerce_template (a downloaded excel spreadsheet)

Installation

I use setuptools for installation, and I have created a gitignore for venv so you can simply issue the commands below in your terminal to install and activate the environment.

cd app
virtualenv venv
. venv/bin/activate
pip install -r requirements.txt
pip install --editable .

Note: This app was designed in a Python 3.8 environment, it uses f-strings so you'll want to have at least a Python 3.x virtual environment.

Basic Usage

The basic usage takes two command line parameters: an input csv, and an output.csv file (full path to file)

$ shopify2woo orders_export_1.csv /tmp/woo_output.csv
Exported 11000 orders(s)

In this example, we read in an order export generated by Shopify called orders_export_1.csv that contains 11,000 orders and re-write them out in WooCommerce CSV format into /tmp/woo_output.csv.

Advanced Options

--sku-placeholder TEXT

This option is designed to offer users the ability to add a SKU to a product/item found in the Shopify orders if it does not have one (the sku is missing). This will fail to import into WooCommerce as each item will need a SKU to associate itself.

Use this feature in conjunction with "Allow Unknown Products" checkbox during the import with CVS Import Suite and get your product imported with the right pricing, this will leave an "Unknown Product" for the order but the price will be present for it and accounted.

--sample INTEGER

This option will allow you to export a smaller sample of your orders to test your data, do smaller dry-run imports or spot check by importing into Google Sheets or Excel. For example, using --sample 10 we can turn our 11k order dataset into 10 orders.

--order TEXT

This option allows you to only export one specific order for a 1-order WooCommerce input. This can help you when trying to massage an entry that will not easily import (without having to dry-run all the data around it).

--clean-only

This option will skip all order entries that will generate a skip/rejection by WooCommerce.

Limitations

There are many limitations to shopify2woo.py, it's designed to import a specific project of a specific size that encountered specific import issues during the process. I encourage others to submit patches or additions to fit their dataset challenges. This tool is just a starter for anyone that needs a beginning spot to data prep for WooCommerce from Shopify.

Taxes

This tool was designed for a New Hampshire, USA based store. We do not have taxes, so I was unable to test all the fields that may be associated with taxes as I don't have data to test it.

Language: English

The only language tested was an English, this may be a flaw for more complicated languages or different character sets.

Other Missing Fields

We encountered a few issues with some of the orders, but it focused mainly around e-mail addresses missing and SKU's missing. Other missing fields may cause WooCommerce to get angry, but I didn't encounter those issues.

Does not combine large datasets

Shopify splits large orders into multiple csv files. For our needs, I simply re-ran Shopify2Woo once for each file and imported the resulting output (since it will not collide with each other).

About

Convert Shopify Orders to Woo Commerce

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages