Top WooCommerce & WordPress Plugins › Forums › Maximum Products per User for WooCommerce › How can I limit the purchase to the customer who does not have any membership?
- Support forum for the Maximum Products per User for WooCommerce.
- This topic has 1 reply, 2 voices, and was last updated 1 year, 9 months ago by
Pablo.
- AuthorPosts
-
February 3, 2022 at 11:45 pm #100866
veronica
GuestAll my user_roles are customers but I dont want to have to force all users to be on a membership so can I limit those who do not have a membership?
[alg_wc_mppu limit="10" term_id ="161" membership_plan="advanced-membership"] [alg_wc_mppu limit="3" term_id ="161" membership_plan ="-1"]
I want to only place limits on people who do not have memberships and let the others memberships have no limits or counters.
[alg_wc_mppu limit="10" term_id ="161" membership_plan="advanced-membership"][alg_wc_mppu limit="0" term_id ="161" membership_plan="unlimited-membership"] [alg_wc_mppu limit="0" term_id ="161" membership_plan="lifetime-membership"] [alg_wc_mppu limit="3" term_id ="161" membership_plan ="-1"]
March 3, 2022 at 1:49 pm #100867All my user_roles are customers but I dont want to have to force all users to be on a membership so can I limit those who do not have a membership?
You can simply add the shortcodes starting with the more specific to the ones more generic, because the algorithm stops when the first matching shortcode is found (from top to bottom).
So, considering your example, I think it would work like this:
[alg_wc_mppu limit="10" term_id="161" membership_plan="advanced-membership"] [alg_wc_mppu limit="3" term_id="161"]
I want to only place limits on people who do not have memberships and let the others memberships have no limits or counters.
The same thing. You can start with the shortcodes containing the more specific rules, i.e., the memberships, and at the end you can add generic limits. There is no need to use the
-1
onmembership_plan
. Example:[alg_wc_mppu limit="0" term_id ="161" membership_plan="unlimited-membership"] [alg_wc_mppu limit="3" term_id ="161"]
- AuthorPosts
- You must be logged in to reply to this topic.