• Resolved tahir1710

    (@tahir1710)


    Hi, I hope you are doing great! I am having trouble finding a solution which can restrict user to download specific number of products per month based on subscription or membership level. Here is what I am trying to achieve:

    If a user has quarterly subscription(3 months) he can download 10 per products per month as long as subscription is active.
    If a user has annual subscription he can download unlimited number of products during the whole year.

    If a user don’t have any subscription he has to buy product individually, at certain price or get subscription to download 10 or unlimited Prodcuts based on subscription level.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Pablo Pacheco

    (@karzin)

    Hi @tahir1710 ,

    If a user don’t have any subscription he has to buy product individually

    I’m considering that each product can be purchased only once and as you didn’t specify a period I’m considering that it will be lifetime. In that case, you can simply enable the Limits > All products option, set the Limit per user option as 1, and set the General > Date range as Lifetime.

    The General > Mode option can be set as Product Quantities

    Now, to fulfill the other requirements, there is a workaround you could try:
    – Enable Limits > Per product tag
    – Assign a tag to all your products and take note of the ID, let’s say the ID is 21.
    – Enable Formula > Limits by formula
    – Use these formulas:

    
    [alg_wc_mppu limit="999999" term_id="21" membership_plan="annual"]
    [alg_wc_mppu limit="10" term_id="21" membership_plan="quarterly"]
    

    And as you want different date ranges depending on the membership you’d have to add this to your functions.php:

    add_filter( 'alg_wc_mppu_date_to_check', function ( $date_to_check, $date_range, $current_time ) {
    	if ( ! function_exists( 'wc_memberships_is_user_active_member' ) ) {
    		return $date_to_check;
    	}
    	if ( wc_memberships_is_user_active_member( get_current_user_id(), 'annual' ) ) {
    		$date_to_check = ( $current_time - YEAR_IN_SECONDS ); // last 365 days.
    	} elseif ( wc_memberships_is_user_active_member( get_current_user_id(), 'quarterly' ) ) {
    		$date_to_check = ( $current_time - MONTH_IN_SECONDS ); // last 30 days.
    	}
    	return $date_to_check;
    }, 10, 3 );

    Note: I’ve used 999999 for the unlimited number of products, but you can use any number that suits you better.

    Let me know if it helps.

    Thread Starter tahir1710

    (@tahir1710)

    Hi pablo, I am Very thankful for your timely response.

    Here is what I want in case I couldn’t explain it better in original post:
    The users with quarterly subscription/membership should be restricted to 10 product download / purchases per month. As products will be documents, it doesn’t matter if one product is purchased / downloaded twice, although it would be nice to have a restriction to let user download certain product only once.

    Users with annual subscription can download unlimited products.

    Users with no subscription / membership should pay price per document in order to access it’s download link.

    I want date range only on quarterly subscription, where user buys 10 products per month for three months. If user has bought 10 products within the month he should be restricted to download any other product until next month.

    Also please suggest whether woocommerce subscription or membership will work with it better. And what does plugin’s pro version offers?

    Looking forward to your response and suggestion!

    • This reply was modified 3 years ago by tahir1710.
    Plugin Contributor Pablo Pacheco

    (@karzin)

    Don’t mention it ??

    Our plugin does not limit the downloads, only the purchases.

    So the user would be limited to purchase different products per month or it will be the same product?

    Also please suggest whether woocommerce subscription or membership will work with it better. And what does plugin’s pro version offers?

    Our plugin works with WooCommerce Memberships.

    Basically, the pro option allows to create limits:

    – Per product category
    – Per product tag
    – Per individual product
    – By formula (e.g. per user ID; per membership plan etc.)

    By the way, What you’re asking would be only possible in the Pro version.

    As your questions are more related to the pro version, can you please continue this conversation using our forums as this forum has very restrictive rules?

    Thread Starter tahir1710

    (@tahir1710)

    Sure. I am going to post a request there.
    Sse you on the other side ??

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Ok, I’m closing it here then.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘restrict no of products user can buy per month based on their membership level’ is closed to new replies.