AffiliateWP Actions

Description

This hook allows you to reward your user’s points for making referrals using the AffiliateWP plugin. You can select to reward users for signing up as an affiliate, referring signups on your website, or referring WooCommerce store sales.

Available since version 1.6

Known Issues

This hook will not be visible if AffiliateWP is not enabled.

Setup

Make sure you set a point value other than zero for the instances that you want to use. For the store referral instance, please see the guide below.

Store Referrals

When it comes to rewarding store referrals, the hook offers three options:

Set Amount

This is the default option and it will reward/deduct a set amount for all referrals no matter the order amount.

If you have multiple point types setup, you can select to enable this option for any number of types.

Point Stores

If your store has been setup to use points as it’s currency, you can select this option in order to reward a percentage of the order amount to the user that made the referral.

In order to use this option, we must set AffiliateWP to use the same point type that you set your store to use. Before we can do that, we first need to set a unique currency code for our point type. This is the only way that AffiliateWP can display points as a currency. By default the MYC code is used which is not used by any real currency but if you have customized this in your store, you need to add this custom code here as well. For most users this should be left as is.

This option can not be used multiple times! If you have multiple point types setup, this hook can only be enabled for the point type your store is setup to use.

Exchange Rate

If you have multiple point types setup and wish to reward more than one type for each commission, you can do so by enabling the hook for all point types you want to pay out. Just make sure they are all set to use this option for store referrals, the exchange rate, log template can of course be different if you want.

If you have multiple point types setup and wish to reward more than one type for each commission, you can do so by enabling the hook for all point types you want to pay out. Just make sure they are all set to use this option for store referrals, the exchange rate, log template can of course be different if you want.

Refunds

When a store commission is undone, e.g. the commission’s status is changed from “Paid” to anything else, the hook will undo the payment it made when the commission was originally paid out. If however a commission has not been paid out and is undone, the hook will take no action.

Supported Instances

Instance Reference Description
affiliate_signup Give or take points from users for becoming an affiliate.
affiliate_visit_referral Give or take points from users for referring site visits.
affiliate_referral Give or take points from users for earning a commission in a store sale.
affiliate_referral_refund Give or take points from users for a store sale commission being refunded.