WooCommerce Referral System Documentation - B2BWoo

Action and Filter Hook Reference

This is simply a list of action and filter hooks found within B2B Referal System For WooCommerce files. View the source to see supported parameters and usage.

Filters, Actions

Filters

    Frontend

  • wrs_image_for_fb_share

    Description:

    Modify Fb image url.

    Parameters:

    (string) $image[0] image url.

  • wrs_url_for_fb_share

    Description:

    Modify Fb url.

    Parameters:

    (string) $url fb url.

  • wrs_title_for_fb_share

    Description:

    Modify Fb title.

    Parameters:

    (string) $title fb title.

  • wrs_description_for_fb_share

    Description:

    Modify Fb description.

    Parameters:

    (string) $description fb description.

  • wrs_referrer_custom_event_label

    Description:

    Modify label description of referrer signup.

    Parameters:

    (string) $referrer_signup_label referrer_signup_label.

  • wrs_referee_custom_event_label

    Description:

    Modify label description of referee signup.

    Parameters:

    (string) $referee_signup_label referee_signup_label.

  • wrs_order_custom_event_label

    Description:

    Modify label description of order.

    Parameters:

    (string) $order_label order_label.

  • Admin

  • wrs_add_extra_settings_in_points_and_rewards

    Description:

    add more Fields added to the existing WCPR settings page.

    Parameters:

    (Array) $settings1 settings1.

Actions

    Frontend

  • wrs_before_clear_cookie_action

    Description:

    Runs before clear cookie upon Logout or product purchase.

  • wrs_after_clear_cookie_action

    Description:

    Runs After clear cookie upon Logout or product purchase.

  • wrs_after_clear_cookie_action

    Description:

    Runs After clear cookie upon Logout or product purchase.

  • wrs_valid_order_limit_reach

    Description:

    Runs once limit of order set by admin reached.

    Parameters:

    (Array) $order order object.

  • wrs_before_order_reward_referrer

    Description:

    Before referrer gets the coupon on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referrer_user->data->ID user id.

  • wrs_after_order_reward_referrer

    Description:

    After referrer gets the coupon on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referrer_user->data->ID user id.

  • wrs_before_order_reward_referee

    Description:

    Before referee gets the coupon on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referee_user->ID user id.

  • wrs_after_order_reward_referee

    Description:

    After referee gets the coupon on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referee_user->ID user id.

  • wrs_before_reward_referrer

    Description:

    Before referrer gets the points on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referrer_user->data->ID user id.

  • wrs_after_reward_referrer

    Description:

    After referrer gets the points on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referrer_user->data->ID user id.

  • wrs_before_reward_referee

    Description:

    Before referee gets the points on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referee_user->ID user id.

  • wrs_after_reward_referee

    Description:

    After referee gets the points on purchase action.

    Parameters:

    (Array) $order order object.

    (Int) $referee_user->ID user id.

  • wrs_before_signup_coupon_reward_referrer

    Description:

    Runs before signup coupon reward referrer.

    Parameters:

    (Int) $referrer_user->data->ID user id.

  • wrs_after_signup_coupon_reward_referrer

    Description:

    Runs After signup coupon reward referrer.

    Parameters:

    (Int) $referrer_user->data->ID user id.

  • wrs_before_signup_coupon_reward_referee

    Description:

    Runs before signup coupon reward referee.

    Parameters:

    (Int) $referee_user->ID user id.

  • wrs_after_signup_coupon_reward_referee

    Description:

    Runs After signup coupon reward referee.

    Parameters:

    (Int) $referee_user->ID user id.

  • wrs_before_signup_points_reward_referrer

    Description:

    Runs before signup points reward referrer.

    Parameters:

    (Int) $referrer_user->data->ID user id.

  • wrs_after_signup_points_reward_referrer

    Description:

    Runs After signup points reward referrer.

    Parameters:

    (Int) $referrer_user->data->ID user id.

  • wrs_before_signup_points_reward_referee

    Description:

    Runs before signup points reward referee.

    Parameters:

    (Int) $referee_user->ID user id.

  • wrs_after_signup_points_reward_referee

    Description:

    Runs After signup points reward referee.

    Parameters:

    (Int) $referee_user->ID user id.

API Documentation

Authentication

B2B Referal System For WooCommerce use Basic Authentication ,which accept Consumer Key as Username and Consumer Secret as Password generated by Woocommerce Rest Api (WooCommerce > Settings > Advanced > REST API).

Retrieve Referral Link of User.

HTTP Request

GET
{{site_url}}wp-json/wc/v3/wrs/referral_link

Available Parameters

Parameter Description
email required

Sample Response:

{
    "status": 200,
    "data": "https://referralsystem.codupcloud.com?ref=hamza.codup"
}

Coupons

Coupons

Retrieve All coupons for user generated by WooCommerce Referral System Plugin.

HTTP Request

GET
{{site_url}}wp-json/wc/v3/wrs/coupons

Available Parameters

Parameter Description
email required

Sample Response:

{
    "data": [
        {
            "coupon_code": "d0l63yrx",
            "date_expires": "2021-03-31",
            "discount_type": "percent",
            "coupon_amount": "50",
            "reason": "Referee gets coupon on purchase"
        },
        {
            "coupon_code": "7f0wvqsc",
            "date_expires": "2021-03-31",
            "discount_type": "percent",
            "coupon_amount": "5",
            "reason": "Referee gets coupon on Sign Up."
        },
        {
            "coupon_code": "n7sjcrhy",
            "date_expires": "2021-03-28",
            "discount_type": "percent",
            "coupon_amount": "10",
            "reason": "Referrer gets coupon on purchase of its referee."
        },
        {
            "coupon_code": "pivtsfbl",
            "date_expires": "2021-03-27",
            "discount_type": "percent",
            "coupon_amount": "5",
            "reason": "Referrer gets coupon on Sign up of its referee."
        }
    ],
    "status": 200,
    "message": "4 Coupons found for this user."
}

Plugin Settings

Update Setting

Update WooCommerce Referral System Plugin settings.

HTTP Request

PUT
{{site_url}}wp-json/wc/v3/wrs/update_settings

Available Parameters

Parameter Description
wcrs_integration_type_for_purchase minimum 1 required

Sample Response:

{
    "status": 200,
    "data": {
        "options": {
            "wcrs_integration_type_for_purchase": [
                "wcrs-integration-purchase",
                "both-integration-purchase"
            ]
        },
        "current_value": {
            "wcrs_integration_type_for_purchase": "wcrs-integration-purchase"
        }
    }
}

Get Setting

Retrieve WooCommerce Referral System plugin settings.

HTTP Request

GET
{{site_url}}wp-json/wc/v3/wrs/get_setting

Available Parameters

Parameter Description
setting_name optional

Sample Response:

{
    "status": 200,
    "data": {
        "current_value": "wcrs-integration-purchase",
        "options": [
            "wcrs-integration-purchase",
            "both-integration-purchase"
        ]
    }
}

Template Overriding

How To Edit

Edit files in an upgrade-safe way using overrides. Copy the template into a directory within your theme named
/woocommerce-referral-system keeping the same file structure but removing the /templates/ subdirectory.

The copied file will now override the B2B Referal System For WooCommerce default template file.

Warning: Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost.

Template list

Template files can be found within the /woocommerce-referral-system/templates/ directory:

  • admin
  • emails
  • frontend
B2B Referal System For WooCommerce hooks documentation generated by Codup

Let’s Talk

We’re currently seeking beta testers for our managed cloud offering. Interested?