Vendor Limit Of Number Of Categories A Product Can Be Assigned

I have noticed that User Group privileges consist of only radio button options, to turn things on or off,

but no inputs to limit amounts for anything.

For instance, in Multi-vendor, there is no place in Group Privileges to limit the number of categories for one product. Also, no such settings is available to Vendor plans.

Without this, a vendor could add a product to limitless categories, causing alot of work to admins to clean up.

Thanks for taking this in consideration.


There is no such a setting out of the box. You can only specify necessary categories for vendor in the vendor plan settings

I used this function for my needs, vendors can assign their products to only one category, all alternatives will gets deleted. also you can build/write a code for some extra your needs here, within in this function. hope this helps you.
for example, add field on vendor_plan table called "num_cat_for_product" and read it within in this function. let say plan allowed 2, and if products_categories table has more than it's allowed, then keep top 2 and delete all others.

that is what are you asking, isn't?

function fn_mycustom_update_product_categories_post(&$product_id, $product_data, $existing_categories, $rebuild, $company_id)
    if (AREA !== 'A') {
db_query('DELETE FROM ?:products_categories WHERE product_id = ?i AND link_type = "A" ', $product_id);