Click A Tree adds a simple "plant a tree" upsell to your WooCommerce shop. Customers can add one or more
real trees to their cart or checkout. The customer pays for the tree, you keep a margin, and Click A Tree
plants the tree and takes care of the certificate.
The plugin is deliberately thin. It handles the storefront and admin side inside your shop; the actual
planting, accounting and certificates run on the Click A Tree service (this is a Software-as-a-Service
model, see "External services" below). A free Click A Tree account and an API key connect the two.
What the plugin does in your shop
- Adds a hidden, virtual "tree" product (price configurable, default 5.00). One item = one tree.
- Shows an "add a tree" widget in both the classic and the block based cart and checkout.
- Reports paid orders that contain trees to Click A Tree so the trees get planted (HMAC signed request).
- Shows an impact dashboard in the WordPress admin: trees planted, CO2, your margin and your prepaid balance.
- An onboarding page under WooCommerce to store your API key and set the tree price.
What works without a Click A Tree account
You can install the plugin, set the tree price, and see the tree product and the cart and checkout widget
in your shop right away. No data is ever sent anywhere until you enter an API key. The external service is
only needed for the part it is responsible for: actually planting the trees, issuing certificates and
returning your impact statistics.
Source code and build
The block based cart and checkout widget is compiled into the "build" folder. The full human readable
source is shipped with the plugin in the "src" folder, together with the build configuration
("webpack.config.js" and "package.json"). The compiled files are generated with @wordpress/scripts. To
rebuild them from source, run "npm install" and then "npm run build" in the plugin folder. No code is
minified or obfuscated beyond this standard build step.
- Install and activate the plugin. WooCommerce must be installed and active.
- Go to WooCommerce > Click A Tree.
- Enter your Click A Tree API key and, if you want, change the price per tree.
- That is it. The "add a tree" widget now appears in your cart and checkout, and paid orders with trees are
reported to Click A Tree automatically.
You can follow your results any time under WooCommerce > Click A Tree Impact.