This feature is now natively implemented in WooCommerce. Repo will no longer be used.
MVP/Prototype of order attribution/source functionality in WordPress.
WooCommerce Order Source Attribution helps merchants understand which marketing activities, channels or campaigns are leading to orders in their stores.
WooCommerce Order Source Attribution requires recent versions of PHP (7.4 or newer), WordPress, and WooCommerce (we recommend the latest, and support the last two versions, a.k.a. L-2).
Install dependencies:
npm install
to install JavaScript dependencies.composer install
to gather PHP dependencies.
Now you can build the plugin using one of these commands:
npm build
: Build a production version and package it as a zip file.
develop
branch is the most up-to-date code.
There are several development tools available as npm scripts. Check the package.json
file for more.
npm run lint:php
: Runphpcs
to validate PHP code style.
Please use these tools to ensure your code changes are consistent with the rest of the code base. This code follows WooCommerce and WordPress standards.
Install composer
, git
, svn
, and either wget
or curl
.
Change to the plugin root directory and type:
$ composer install
To run the unit tests you need WordPress, WooCommerce, and the WordPress Unit Test lib (included in the core development repository).
Install them using the install-wp-tests.sh
script:
$ ./bin/install-wp-tests.sh <db-name> <db-user> <db-pass> <db-host>
Example:
$ ./bin/install-wp-tests.sh wordpress_tests root root localhost
This script installs the test dependencies into your system's temporary directory and also creates a test database.
You can also specify the path to their directories by setting the following environment variables:
WP_TESTS_DIR
: WordPress Unit Test lib directoryWP_CORE_DIR
: WordPress core directoryWC_DIR
: WooCommerce directory
Change to the plugin root directory and type:
$ vendor/bin/phpunit
The tests will execute and you'll be presented with a summary.
Made with 💜 by WooCommerce.
We're hiring! Come work with us!