This function will retrieve the amount of points a WooCommerce product is set to reward when purchased, or an array of point types with their associated values if more than one point type exists. Supports both single or variable product types.
(bool) FALSE
if the product ID is invalid, an array of the reward setup for all point types or the point value in string form when used to retrieve a particular point type.
Param | Type | Required | Description | |
---|---|---|---|---|
function mycred_get_woo_product_reward( |
||||
$product_id |
int | Yes | The WooCommerce product post object ID. |
|
$variation_id |
int | No | Should be set to |
|
$requested_type |
bool or string | No | Use |
|
) { ... } |
Example 1: Basic usage example where we show how much points a product rewards (if set).