VirtoCommerce.Subscription module represents subscriptions and recurring orders management system. It enables retailers to sell subscription-based offerings and shoppers to place recurring orders online.
- Trial periods
- Grace periods
- Free subscriptions
- Product or bundle selling on a subscription
- Multiple products via one subscription
- View a list of existing subscriptions with filtration and sorting
- View full subscription history with all notifications, invoices and changes
- Update active subscriptions (including payment plan changes)
- Manual invoicing on subscription with any amount
- Notifications for each life phase and subscription events
- Possibility to use templates for notifications;
- Possibility to edit notification templates and manage the list of notification types
- View information about upcomming Invoice
Recurring order scenario
- Customer adds products to cart and proceeds to checkout;
- Customer selects "I want this to be a recurring order" option:
- Customer sets the recurrence parameters:
- Customer proceeds with the checkout and submits the order;
- System creates both the order and a subscription based on that order;
- System background job checks periodically the existing subscriptions and generates new orders (if needed);
- System sends email notification to the customer about the new order;
- Customer receives the email and clicks the link to open the order in storefront;
- Customer reviews the order and confirms payment;
- Alternatively, customer opens the associated subscription and cancels it. No more new orders would be generated for this subscription ever again.
- Customer Service Representative (CSR) creates a new product and defines auto-order schedule for it on admin side;
- Customer orders the product on storefront;
- The system displays the subscription schedule under the product;
- There will be no possibility to select "I want this to be a recurring order" during checkout;
- The following steps are identical to the ones in "Recurring order scenario" starting from step 5.
Subscription "UML state machine" diagram:
Subscriptions are used for generating new Orders under some rules. That is why we always store 2 entities: Subscription and associated Order. The latter we call a "prototype Order" as future Orders will be generated from it.
- When a Customer creates an Order on storefront, it's sent to Orders service;
- Orders service saves the Customer Order to database and also fires OrderChangeEvent even;
- Subscription module receives OrderChangeEvent (containing the Order);
If this was a newly created Order with associated payment plan (and not a prototype for some Subscription), then:
- Create a new Subscription - clone given Order and associate it with the new Subscription. If the received Order was generated by a Subscription, then the Subscription should be updated (status, balance recalculated, etc.). This includes the scenario when new Order was generated by Process Subscription Job.
At the step the Subscription module creates a scheduled job that initiates Subscription processing periodically. It reads active Subscriptions from database and generates new Orders (if needed).
Installing the module:
Automatically: in VC Manager go to Configuration -> Modules -> Subscription module -> Install
Manually: download module zip package from https://github.com/VirtoCommerce/vc-module-subscription/releases. In VC Manager go to Configuration -> Modules -> Advanced -> upload module package -> Install.
- Subscription.EnableSubscriptions - Flag for activating subscriptions in store;
- Subscription.Status - Subscription statuses (Trialling, Active, Cancelled, Expired, etc.);
- Subscription.SubscriptionNewNumberTemplate - The template (pattern) that will be used to generate the number for new Subscription. Parameters: 0 - date (the UTC time of number generation); 1 - the sequence number;
- Subscription.EnableSubscriptionProccessJob - Flag for activating automatic subscription process
- Subscription.EnableSubscriptionOrdersCreatejob - Flag for activating automatic order creation for subscription
- Subscription.CronExpressionOrdersJob - Cron expression for scheduling subscription order creation job execution
Subscription.PastDue.Delay - Delay in days when unpaid subscription obtain PastDue status
Subscription.CronExpression - cron expression for scheduling subscription processing job execution.