• Resolved dgebel

    (@dgebel)


    I’m setting up a page with 4 subscriptions, with 1 product for each subscription.

    I was able to get PMS restrictions?working for a single subscription’s product using the 2nd code segment?on?https://www.cozmoslabs.com/docs/paid-member-subscriptions/developer-knowledge-base/exclude-restricted-products-from-woocommerce-queries/

    i.e. on a page with the [products] shortcode, only the product for the subscription is displayed.

    However, I have 4 different subscription types. I duplicated the subscriptions and modified them to reflect the differences between the subscription types. Created 3 duplicates of the working product and modified the restrictions to reflect the matching subscriptions.

    Only the first subscription works properly (i.e. going to the page with [products] shows the single product. Buying a subscription (different users) for the second, third & fourth products results in *nothing* being displayed on [products] page.

    I dumped some of the variables. On the working product, the first element in the array of restricted products is missing (ie the product-id codes for all products except the desired product show as restricted), so the one product is displayed. On all the other products, *all* of the products are in the list of restricted product ids, so nothing is displayed, instead of the subscribed product.

    ie, the arg array for the 1st working product is:

    arg=Array ( [1] => 516 [2] => 524 [3] => 525 )

    while when the page is displayed for non-working products, the result is

    arg=Array ( [0] => 463 [1] => 516 [2] => 524 [3] => 525 )

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @dgebel,

    What you explained should work correctly.

    Can you try to create some separate products and apply restriction rules normally? Don’t use the duplicate function.

    The plugin thinks that you can’t access the products that aren’t displayed, so that’s why those arrays differ. Make sure the subscription is active and expiration date is in the future.

    If you want to dig further, you should look at the pms_filter_content function. This is where the plugin determines if something is restricted or not.

    Regards.

    Thread Starter dgebel

    (@dgebel)

    Was tearing my hair out – I got it working, then it wasn’t working again, etc. etc.

    Finally figure out that the paypal was the issue. I don’t have that set up yet, and “buying” the additional subscriptions only put them into PENDING state – I didn’t know what the blue vs green circles were on the member listing! It would be better if there was a status column.

    Once I figured that out, everything worked as expected.

    Strangely, when I showed all the products on the product page, only the subscribed product showed the product image – the other products just had the default grey box.

    Thanks for the help. I’ll put another ticket if I can’t get Paypal working right.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restrictions only partially working’ is closed to new replies.