Skip to content

dvdl16/woocommerce_fusion

Repository files navigation

WooCommerce Fusion

CI workflow codecov

WooCommerce connector for ERPNext v15

This app allows you to synchronise your ERPNext site with multiple WooCommerce websites

Features

User documentation

User documentation is hosted at woocommerce-fusion-docs.finfoot.tech

Manual Installation

  1. Install bench.

  2. Install ERPNext.

  3. Once ERPNext is installed, add the woocommerce_fusion app to your bench by running

    $ bench get-app https://github.com/dvdl16/woocommerce_fusion
  4. After that, you can install the woocommerce_fusion app on the required site by running

    $ bench --site sitename install-app woocommerce_fusion

Tests

Requirements

For integration tests, we use WordPress Playground to spin up temporary Wordpress websites:

npm i @wp-playground/cli

You also need to install Caddy, which acts as a reverse proxy. This allows us to call the Wordpress/WooCommerce API over SSL so that the same authentication method is used as production sites

Furthermore, have a Frappe site available with ERPNext and WooCommerce Fusion pre-installed.

Run unit and integration tests

  1. Navigate to the app directory
cd frappe-bench/apps/woocommerce_fusion
  1. Start Wordpress Playground
npx @wp-playground/cli server --blueprint wp_woo_blueprint.json  --site-url=https://woo-test.localhost
  1. Start Caddy
caddy run --config wp_woo_caddy --adapter caddyfile

Should you want to check out the locally running wordpress instance, navigate to https://woo-test.localhost in your browser. The default login details are admin and password

  1. Set the correct environment variables and run the tests
export WOO_INTEGRATION_TESTS_WEBSERVER="https://woo-test.localhost"
export WOO_API_CONSUMER_KEY="ck_test_123456789"
export WOO_API_CONSUMER_SECRET="cs_test_abcdefg"
bench --site test_site run-tests --app woocommerce_fusion --coverage

Development

We use pre-commit for linting. First time setup may be required:

# Install pre-commit
pip install pre-commit

# Install the git hook scripts
pre-commit install

#(optional) Run against all the files
pre-commit run --all-files

We use Semgrep rules specific to Frappe Framework

# Install semgrep
python3 -m pip install semgrep

# Clone the rules repository
git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules

# Run semgrep specifying rules folder as config 
semgrep --config=/workspace/development/frappe-semgrep-rules/rules apps/woocommerce_fusion

If you use VS Code, you can specify the .flake8 config file in your settings.json file:

"python.linting.flake8Args": ["--config=frappe-bench-v15/apps/woocommerce_fusion/.flake8_strict"]

The documentation has been generated using mdBook

Make sure you have mdbook installed/downloaded. To modify and test locally:

cd docs
mdbook serve --open

License

GNU GPL V3

The code is licensed as GNU General Public License (v3) and the copyright is owned by Finfoot Tech (Pty) Ltd and Contributors.