How to add custom post type “package” as object in rates (no woocommerce)

Hello,
We have purchased Affiliates Pro and are using it on a client site that does not use WooCommerce.
Instead, we have a custom post type called “package”.
Our goal:
We want to assign affiliate rates to individual packages and have them appear in the “Object” column in the Rates section.
However, the “package” post type does not appear as a selectable object when creating or editing a rate.
What we have tried:
We added these filters to our theme’s functions.php:

add_filter(‘affiliates_supported_post_types’, function($post_types) {
$post_types[] = ‘package’;
return array_unique($post_types);
});

add_filter(‘affiliates_integrations’, function($integrations) {
$integrations[’package’] = array(
‘label’ => ‘Custom Package’,
‘post_type’ => ‘package’
);
return $integrations;
});

But the “package” post type still does not appear in the Object dropdown.
Question:
How can we make our custom post type (“package”) selectable as an Object when creating/editing a rate in Affiliates Pro?
Is there a filter, hook, or recommended method for this?
Thank you for your help!


Comments

One response to “How to add custom post type “package” as object in rates (no woocommerce)”

  1. George Avatar
    George

    Hi there,

    Welcome to our support channel for Affiliates Pro and its addons.

    In order for a post_type to appear in the select list of Objects, additional implementations are needed in the plugin core, which include an integration with Affiliates Pro.
    However, before reaching that point, would you mind sharing additional details with us regarding your decision? What is the purpose of adding your custom post_type in Rates? Also, since the rate and its options are the way that the system decides whether a specific rate should apply for a referral, what is the action that will record the referral?

    The referral-related integrations found in Affiliates > Settings > Integrations(tab) are designed to track specific referred-user actions and record referrals. For example, the Affiliates WooCommerce integration tracks WC sales and grants a commission when a sale is referred by a valid affiliate. In a similar way, the Affiliates Ninja Forms integration will track form submissions and grant commissions.

    In your case, what is the action that should be tracked and grant a commission to the applicable affiliate?

    Apologies for all these questions, but the important point here is to figure out first how and when should a referral be recorded and then figure out, how can the custom post_type appear in Rates.

    Kind regards,
    George

Only authorized members can comment on this topic.

Log in