Restrictions only partially working
-
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 )
- The topic ‘Restrictions only partially working’ is closed to new replies.