Hello,
Thanks for following up.
You can limit the purchase of products by assigning your customer to a user role after they purchase the membership. But if the membership is renewed, then the purchase limit won’t be reset for that user automatically. In that case, you would need to reset the purchase limit manually. However, if that is acceptable to you, please follow the general instructions below to set the maximum purchase limit for category1 for the customer with the RoleA user role:
1. At first, please navigate to WooCommerce > Settings > Maximum Products per User > General and set Mode to Product Quantities
. Then set the Date range and Order statuses to appropriate values
.
2. Then go to the Limits section and enable the Per product category option.
3. Next go to the Formula section, enable the Limit by formula option and in the Formula field paste shortcode such as:
[alg_wc_mppu limit="1" user_role="rolea" term_id="20"]
Here, 20
is the ID of the categoryA.
4. Now to reset the purchase limit manually, please go to the Admin section and enable the Admin Options > Editable sales data option. After that, you will be able to edit each user’s sales data on the user’s edit page (in Users). To reset the limit there, you would set the value of the Order’s value to 0
.
With this configuration, the member with the RoleA user role will still be able to buy products from other categories without any limit.
I hope you find the information helpful. If you have any questions, then please let us know.
Kind regards,
Moshtafizur