A free points management plugin for WordPress.
myCRED Logo
myCRED Logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download
    Navigation
    • Loading navigation ...
    All Hooks
    Automatic points for:
    1. AffiliateWP Actions
    2. Anniversary
    3. BadgeOS Achievements
    4. bbPress Actions
    5. BuddyPress Group Actions
    6. BuddyPress Profile Actions
    7. Clicking on Links
    8. Comments
    9. Daily Visits
    10. Deleting Content
    11. Event Attendance
    12. Inviting Users
    13. Jetpack Subscriptions
    14. Logins
    15. Product Purchases
    16. Product Referrals
    17. Product Reviews
    18. Publishing Content
    19. Referrals
    20. Registrations
    21. rtMedia Uploads
    22. ShareThis Actions
    23. Simple:Press Actions
    24. Submitting Contact Form 7 Forms
    25. Submitting Gravity Forms
    26. UserPro Followers
    27. UserPro Private Messaging
    28. UserPro Verifications
    29. Viewing Content
    30. Watching Videos
    31. WP Favorite Posts Actions
    32. WP-PostRatings Actions
    Categories
    Filter by category
    1. Actions
    2. Classes
    3. Filters
    4. Functions
    5. Hooks
    6. Objects
    7. Shortcodes
    8. Template Tags
    Chapters
    Documentation
    1. Chapter I - Introduction
    2. Chapter II - Getting Started
    3. Chapter III - Add-ons
    4. Chapter IV - Premium Add-ons
    5. Chapter V - For Developers
    6. Chapter VI - Reference Guides
AffiliateWP Actions

Codex / Hooks / Third-party / AffiliateWP Actions

Description

This hook allows you to reward your users 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 your store is using a real currency and AffiliateWP is setup to use the same currency, you can select this option in order to convert users commissions into their point value using an exchange rate. This exchange rate is then applied to the commission amount and paid out in points.

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.
0

About myCred

myCred is a free, open-source and developer friendly points management tool for WordPress powered websites.

Download Rate Plugin

Documentation

  • Add-ons
  • Core Shortcodes
  • F.A.Q.
  • Tutorials
  • Third Party Plugins
  • Code Snippets

Support

  • Product Licenses
  • Customization
  • Support Forums
  • Plugin Changelog
  • Contact

Copyright 2013 - 2021 by WPExperts; All rights reserved. myCred is licensed under GPL 2.0

Terms & Conditions • Use of Cookies • Store Policy • Community Rules

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.

logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download