How can I limit users to only purchasing one variation of product subscriptions?

Top WooCommerce & WordPress Plugins Forums Maximum Products per User for WooCommerce How can I limit users to only purchasing one variation of product subscriptions?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #100449
    han van
    Participant

    hi, i just bought your plugin.
    i want to allow people to only buy max 1 variation in a product subscription (WooCommerce Subscriptions). they should still be able to up or downgrade the variation. is this possible?

    Han

    #100450
    Tom Anbinder
    Moderator
    Plugin Support

    Hi,

    Yes, I believe this is possible.

    1. First you need to enable “Use variations” checkbox in “WooCommerce > Settings > Maximum Products per User > General”.

    2. Then you need to enable “Per product” checkbox in “WooCommerce > Settings > Maximum Products per User > Limits”.

    3. After that you need to go to your variable subscription product admin edit page, and there you will be able to set limit (i.e. 1) for the variation you need. Leave it as zero for other variations.

    Hope that helps. Please let me know if you have any questions.

    #100451
    Tom Anbinder
    Moderator
    Plugin Support

    Update: after reading your question again, I’m now thinking – maybe you meant “… buy 1 of any variation…” (i.e. no matter which variation)? If that’s the case, then you don’t need to enable “Use variations” checkbox from my previous post. I.e. in this case steps are:

    1. Enable “Per product” checkbox in “WooCommerce > Settings > Maximum Products per User > Limits”.

    2. Go to your variable subscription product admin edit page, and set limit to 1.

    Please let me know if I misunderstood you.

    #100452
    han van
    Participant

    Yes, with the variation option disabled it all work fine.
    but i have multiple subscription products. some of them i want the user to be able to buy multiple variations.

    i enable ‘Variations’ and ‘All products’ is set to 1 and ‘Per product’ is on in your plugin;
    when i set all the variations in the subscription product to 0 (i would think global setting would prevail) a user can still buy more than one variation of the subscription. namely the global setting of 1 is applied to every separate variation. is this correct?

    #100453
    Tom Anbinder
    Moderator
    Plugin Support

    Hi,

    Yes, when you enable the “Use variations” option, each variation is treated as an individual product. So if you set the limit to 0, then (as you correctly noted) “All products” value is used as a fallback. If I understood you correctly, what you actually need is to keep the “Use variations” option enabled, but make an exclusion for some products, and for them use limit as if the “Use variations” option is disabled. If that’s correct, I could try to add this feature to the plugin. Also, if you’d like a faster solution, I could come up with a PHP snippet, which you would need to add to your (child) theme’s functions.php file. Please let me know what you think.

    #100454
    han van
    Participant

    hi,
    your suggestion is extremely useful but it would not solve my current challenge.
    i am using a variable product in a product bundle (https://woocommerce.com/products/product-bundles/)

    this plugin stops your plugin from recognizing the variable subscription product as bought because the product-bundle is product itself. the variable subscription shows as bought in the account-page though.

    i would like users to be able to choose and buy only one variation of a product inside a bundled product. so if your plugin could detect that the user has bought a variation, none of the other variations can be bought.

    #100455
    Tom Anbinder
    Moderator
    Plugin Support

    Hi,

    Would it be possible for me to log in to your site? It would be much easier for me to understand the task then. If that’s possible, my email is [email protected].

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.