Hi forum, i have more then one store (clothing) with products that have more then 40 variants (child product).
All variants retain the same name and when I try to save the 41st, virtuemart gives me the following error:
You are not an administrator or the correct vendor, storing of product cancelled
With a bit of debug, I understood that the problem is given by the automatic generation of the slug, more precisely in the file administrator/components/com_virtuemart/helpers/vmtable.php.
The offending function is checkCreateUnique that try to create a slug for 40 times. If my products are named all "T-Shirt" the slugs will be "t-shirt", "t-shirt-1", "t-shirt-2"... "t-shirt-39" and after this last, i can't add more childs because the cicle (while ($i < 40)) finished without a slug and return false. Wouldn't it be more correct to use a recursive function or at least to parameterize this value (40)?
Thank you in advance!
[EDIT]
To reproduce the error just create 41 products with the same name (there is no need to enter other data): the 41st will return the error indicated above. I have tested the problem on all versions of VM since 3.6
very easy: you must create slug manually, what's the problem?
QuoteAll variants retain the same name
Very bad idea, if you send to Google Merchant Centre, then product name must with variant option.
Change the name of child and add to product name parameters name too.
Parent: T-SHIRT
Child: T-SHIRT Blue
Yours is a good reply, but i think that this is a bug :)
Definitely technically.
But on the business side, I don't think so, and I thank the VM Dev Team for putting that restriction there. At least the administrators will wonder why this is so
Obviously