Dynamic coupons

Dynamic coupons are a new type of coupon within AffiliateWP.

Rather than needing to manually create and assign a new coupon for every affiliate that needs one, affiliates can have a dynamic coupon automatically generated for them. This can happen as each new affiliate registers, or in bulk by the site admin at any time.

All dynamic coupons inherit their coupon settings from the designated coupon template. This makes updating the details of a coupon extremely easy. Just update one WooCommerce coupon, and all affiliate’s dynamic coupons now use the new settings.

The following fields are inherited by dynamic coupons from the coupon template:

  • amount
  • discount_type
  • excluded_product_ids
  • excluded_product_categories
  • product_ids
  • individual_use
  • free_shipping
  • exclude_sale_items
  • date_expires

Enabling dynamic coupons

Create a new coupon (if needed) by going to WooCommerce » Marketing » Coupons.

Next, from AffiliateWP » Settings » Coupons, select the coupon you created in step one from the Coupon Template select menu.

AffiliateWP - Settings - Coupons screen in the admin

Automatically generating dynamic coupons for affiliates

When affiliates join your program, dynamic coupons can be automatically generated for them.

To do this, enable the Automatically Generate Coupons option. You can find this option also on the AffiliateWP » Settings » Coupons screen:

setting to Automatically Generate Coupons for each affiliate

Once enabled, a dynamic coupon will be automatically generated when:

  • An affiliate registers from the front-end using the default affiliate registration form.
  • Affiliate approval is enabled, and an affiliate is approved from either the Accept quick action link, the Bulk Actions menu, or from the Review Affiliate screen.
  • An affiliate is added manually from within the WordPress admin, and the Affiliate Coupon checkbox is enabled.
  • Affiliate accounts are created when the setting Automatically register new user accounts as affiliates is enabled in AffiliateWP » Settings » Affiliates.

Dynamic Coupon Customization

You can also customize how the coupon names will be formatted when generated with a coupon format, custom text, and a hyphen delimiter.

dynamic coupon customization

The coupon format merge tag names can be put together in any order desired:

  • {user_name}
  • {coupon_code}
  • {coupon_amount}
  • {custom_text}

For example, for an affiliate with the username of Alfred and a coupon discount amount of 10%, this would be {user_name}{coupon_amount}, resulting in Alfred10 as the actual coupon code generated.

There is also the option to insert a hyphen in between each coupon merge tag.

Bulk generating dynamic coupons

Dynamic coupons can be bulk generated for all affiliates that do not currently have a dynamic coupon.

Go to AffiliateWP » Tools » Coupons, and click the Generate Coupons button. A dynamic coupon will be generated for all active affiliates that do not already have a dynamic coupon assigned.

It is also possible to bulk generate dynamic coupons for all affiliates and override all existing dynamic coupons. If an affiliate already has a dynamic coupon, an entirely new coupon will be generated for them.

To override all dynamic coupons, enable the setting Override existing coupon for all affiliates. Then, click the Generate Coupons button.

Generating a dynamic coupon for a specific affiliate

A dynamic coupon can be generated for a specific affiliate.

Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.

Next to Dynamic Coupon Code, click the Generate Coupon button if one does not exist, or, click Delete Coupon first if they already have a coupon code generated, but want a new one.

Dynamic Coupon Generate Coupon
Dynamic Coupon Delete Coupon

Deleting a dynamic coupon for a specific affiliate

A dynamic coupon can be deleted for a specific affiliate.

Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.

Next to Dynamic Coupon Code, click the Delete Coupon button (see image above).

The coupon code will then be deleted.

Showing a dynamic coupon to the affiliate

Dynamic coupons can be shown to an affiliate from either:

  • The Affiliate Area
  • The affiliate accepted email

Affiliate Area

A new Coupons tab will show within the Affiliate Area and the Affiliate Portal screens if:

  • An affiliate has a dynamic coupon code assigned to them.
  • An affiliate has one or more manually assigned coupon codes assigned to them.

Application accepted email

Use the new {registration_coupon} email tag to display a dynamic coupon to the affiliate as soon as they have been accepted into your affiliate program.

  • Go to AffiliateWP » Settings » Emails
  • In the Application Accepted Email Content text area, enter the {registration_coupon} email tag:
  • When an affiliate registers they will see the coupon code within their acceptance email: