1. Documentation /
  2. AutomateWoo /
  3. Actions /
  4. Subscription - Add / Remove Coupon Actions

Subscription – Add / Remove Coupon Actions

AutomateWoo provides two actions for editing the coupons on a subscription created with WooCommerce Subscriptions. One action to add coupons, and one to remove them.

Add Coupon Action

↑ Back to top

The Add Coupon action can be used to automatically discount future payments for a subscription by applying an existing recurring discount coupon.

To add a coupon to a subscription:

  1. Go to AutomateWoo > Workflows
  2. Click Add Workflow
  3. Click the Trigger select box
  4. Choose one of the Subscriptions triggers
  5. Click the Add Action button
  6. Click Add Coupon action in the Subscriptions section
  7. Select for the coupon you wish to apply to the subscription. Only recurring coupon types are available for selection.

The coupon will discount the subscription by the amount set on the coupon. This coupon will then be applied to future renewal payments, unless the coupon is removed, either manually, by a Remove Coupon action, or automatically because it is limited to a number of payments. The same coupon code will only be added once to a subscription, so if the subscription already has the coupon applied, it will not be added.

Subscription Add Coupon Action Example Screenshot
Subscription Add Coupon Action Example

Coupon Validation

↑ Back to top

When an Add Coupon action is run, the same validation that would be applied to the coupon when adding it to the cart or via the Edit Subscription screen will be applied. This means that the coupon will only be applied to the subscription if it fulfils all requirements, like usage restrictions.

If a coupon fails validation, it will not be applied and an error will be logged for the Workflow. These errors can be tracked on the AutomateWoo > Logs page.

Subscription Add Coupon Action Failure Log Example
Subscription Add Coupon Action Failure Log Example

Remove Coupon Action

↑ Back to top

The Remove Coupon action can be used to remove a discount from a subscription. If more than one coupon line item has a code matching the chosen code, all matching coupons will be removed.

To remove a coupon from a subscription:

  1. Go to AutomateWoo > Workflows
  2. Click Add Workflow
  3. Click the Trigger select box
  4. Choose one of the Subscriptions triggers
  5. Click the Add Action button
  6. Click Remove Coupon action in the Subscriptions section
  7. Select for the code for the coupon you wish to remove

Tracking Coupons Changes

↑ Back to top

When a coupon is added or removed from a subscription, a note is added to the subscription to record this action. This makes it easier to keep track of the changing coupons on a subscription over its lifecycle.

The note includes:

  • Name of the Workflow that added or removed the coupon
  • Workflow ID, in case the name of the workflow changes
  • Coupon code

The note has the form:

{workflow_name} workflow run: added coupon {code}. (Workflow ID: {workflow_id})
Add Coupon Subscription Note Example Screenshot
Example Subscription Note for Adding a Coupon

Recommended Triggers

↑ Back to top

By default, Workflows in AutomateWoo run after the event that triggers the workflow. For the add / remove coupon actions to be effective, you need to choose a trigger that occurs before the first payment you want to discount.

The action should also be run as soon as possible so the subscription has the correct coupon line items and totals for the duration of the renewal cycle. This ensures the most accurate details are displayed to the subscriber on their My Account > View Subscription pages, emails and elsewhere.

Because of this, the recommend process for adding or removing coupons is to trigger the action when the previous payment occurs. This can be done using the:

  • Subscription Created trigger to modify the coupons included in the 2nd renewal order onwards; and
  • Subscription Renewal Payment Complete trigger to modify the products including in the 3rd and each future renewal order.

Requirements

↑ Back to top

The Add / Remove Coupon actions will only work for subscriptions using a payment gateway that supports modifications to the recurring total. This feature is necessary for coupons to be dynamically applied during a subscription’s lifecycle.

Furthermore, the actions will only be available with WooCommerce version 3.2 or newer active. This version of WooCommerce introduced the functionality that makes it possible to add coupons to an order or subscription and have discount amounts correctly calculated.

Use Cases

↑ Back to top

Being able to dynamically add and remove coupons on a subscription has many use cases, especially when combined with AutomateWoo’s advanced Rules.

Some example ways to use these actions to help your store stand out from the crowd:

Loyalty Discounts: Provide a discount to loyal subscribers after a given period, like their first year of being an active monthly subscriber.

Multi-tier Pricing: Offer products which increase or decrease in cost over their lifecycle by modifying the discounts applied to the subscriptions containing those products.

Bulk Edit Subscriptions: Change prices for active subscribers without requiring customers to resubscribe, or editing each subscription manually.

Seasonal Sales: Change the discounts a customer receives based on calendar dates for special promotions, like an exclusive Black Friday discount for active subscribers.