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
Product Purchases

Codex / Hooks / WooCommerce / Product Purchases

Description

This hook allows you to reward your users for buying a WooCommerce product in your store. Unlike other hooks, this hook is setup by editing your products and not on the usual hooks page in your admin area.

Each product you edit, you can select to reward with either one or multiple point types. For variable products, as of version 1.7.6, you can also set a unique amount for each variation.

Tick the checkbox to enable points rewards when the product is purchased.

Available since version 1.4

Known Issues

This hook requires WooCommerce to be installed and enabled.

Setup

Edit your product and select the point type(s) you want to reward when the product is purchased and enter a point value.

For variable products, you can still use the myCRED metabox to reward the same amount no matter which variation a user selects, or set a value in each variation.

Supported Instances
Instance Reference Description
reward Give or take points from users for purchasing a product.
No Payouts

In the following instances points are NOT going to be paid out:

  • The buyer is not logged in when placing an order.
  • The buyer is excluded from the point type you set to reward.
  • The order was paid with a manual payment gateway (see example 2 below for a fix to this).
  • The order was paid using points.
  • The product is set to reward zero points.
Popular Customizations

Example 1: Reward store purchases by paying a percentage of the product price as points to the buyer. The percentage to pay is dictated by the category the product is in.

Example 2: By default myCRED will payout points for WooCommerce orders when an order has been marked as “paid“. This means that no points will be paid out if a users pays using a manual gateway such as Check or Bank Transfers. This code snippet will force myCRED to payout when an order has been marked as “Completed“ instead of paid.

Example 3: Reward store purchases by paying a percentage of the order total as points to the buyer.

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