• Hello,
    I have now added the multiple subscription add-on and I was expecting to be able to configure easily the different subscriptions.
    – Free subscription: see all posts but not from category premium
    – Premium subscription: see all posts (including premium category posts)

    This seems not to be possible. It looks like I have to add all categories I want into the free subscription and omit the premium category. This is really painfull as there are 50 categories and regularly new ones are added..

    An other option would be to create a new post type, but this demands also other changes on the theme which lead into a custom development..

    Any other way I may have not seen/understood correctly?

    Thank you for some advice..
    WBW

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter wpblogwriter

    (@wpblogwriter)

    Addition: by the way, doing the way I described, by adding all categories which are allowed in the free subscription (except the one for the premium) leads to a long list of “Unlimited Posts, Unlimited Posts, …” on the register page in the Content access bullet point.. it doesn’t show the selected taxonomy. It requires to overwrite the default content access description.

    Plugin Contributor Jeremy Green

    (@endocreative)

    Hello. We are working on an update to Leaky Paywall that will allow you to add exceptions to Access Rules. That will help with the configuration of the use case you described.

    Thread Starter wpblogwriter

    (@wpblogwriter)

    Sounds good! Hopefully soon ??

    Thread Starter wpblogwriter

    (@wpblogwriter)

    Hi Jeremy,
    Just an example to explain that the current permission rules are give us some trouble.

    – Free subscriber has access to categories A-Y
    – Paid subscribers, to category Z

    My customer now selected to a post the categories A, B and Z and was wondering why all subscribers could see the post content…

    It would be very important to have a negated category..
    -> free subscribers hava access to all categories and ! Z (This should solve the problem)

    Best regards,
    WBW

    I encountered the same issue. Here’s a workaround I came up with in the meantime:

    
        add_filter('leaky_paywall_current_user_can_access', function($can_access) {
            if (!$can_access) {
                return false;
            }
            // *** Replace these with the real values for your site ***
            $PREMIUM_SUBSCRIPTION_LEVEL_ID = 1;
            $PREMIUM_SUBSCRIPTION_TAXONOMY_IDS = [5, 6];
    
            $settings = get_leaky_paywall_settings();
            $restrictions = new Leaky_Paywall_Restrictions();
            $level_ids = leaky_paywall_subscriber_current_level_ids();
    
            // Don't allow access to the premium taxonomies unless the user has
            // a premium subscription
            if (! in_array($PREMIUM_SUBSCRIPTION_LEVEL_ID, $level_ids) ) {
                foreach ($PREMIUM_SUBSCRIPTION_TAXONOMY_IDS as $id) {
                    if ($restrictions->content_taxonomy_matches($id)) {
                        return false;
                    }
                }            
                return $can_access;
            }
        });
    

    There was a mistake in what I posted above. The bottom part of the code should be as follows ($can_access after the if block).

    
            // Don't allow access to the premium taxonomies unless the user has
            // a premium subscription
            if (! in_array($PREMIUM_SUBSCRIPTION_LEVEL_ID, $level_ids) ) {
                foreach ($PREMIUM_SUBSCRIPTION_TAXONOMY_IDS as $id) {
                    if ($restrictions->content_taxonomy_matches($id)) {
                        return false;
                    }
                }            
            }
            return $can_access;
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Multiple Subscriptions / Exclude category’ is closed to new replies.