Skip to content

Automattic/woocommerce-subscriptions-core

trunk
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 21, 2021 09:08
December 20, 2021 14:12
December 20, 2021 14:12
December 20, 2021 14:12
August 11, 2023 09:43
August 11, 2023 09:43

WooCommerce subscriptions-core

This package is a code library used to power core subscriptions related functionality in other products:

Dependencies

Usage

The /Automattic/woocommerce-subscriptions-core/ repository is treated as a development repository and includes development assets, like unit tests and configuration files.

This package should be loaded as follows:

composer.json

"repositories": [
    {
        "type": "git",
        "url": "https://github.com/Automattic/woocommerce-subscriptions-core.git"
    }
],
"require": {
    "woocommerce/subscriptions-core": "1.0.0",
},

my-main-plugin-file.php

require_once PATH_TO_WOOCOMMERCE_SUBSCRIPTIONS_CORE . 'includes/class-wc-subscriptions-core-plugin.php';
new WC_Subscriptions_Core_Plugin();

Development

This repository can also be loaded as WordPress plugin alongside WC Subscriptions or WCPay. This is for development purposes only.

Warning
subscriptions-core as a standalone plugin will not initialize itself, it requies a client product plugin - ie WooCommerce Payments, or WooCommerce Subscription to be active.

Prerequisites

  • Node LTS v16.x.x
  • Composer LTS v2.2.x
  • NVM: We recommend using NVM to ensure you’re aligned with the expected Node version. This repository contains an .nvmrc file which helps ensure you are using the correct version of Node.

After cloning the repo, install dependencies and build:

nvm use
npm install
npm run build

Features provided in core

  • Simple & Variable Subscriptions Product Types
    • Virtual and Downloadable
    • Limited Subscriptions
    • All standard product features: trials period, sign-up fees, synced, one-time shipping
  • Manage Subscriptions (Update the status of subscriptions)
  • All subscription global helper functions (eg. wcs_get_subscriptions_for_order())
  • Subscription Coupons (Sign-up fee and Recurring coupons)
  • Subscriptions REST API endpoints
  • Checkout Blocks + Subscriptions support
  • Support for the WooCommerce Payments gateway
  • Privacy/GDPR exporters for Subscriptions