Concatenate 3 fields when creating product sku from permutations

bryankaran

New Member
So I have a list of words. I wish to create unique permutations as products to be randomly generated and reserved upon. Each permutation would consist of 3 words. Once a product is created, that permutation will be excluded from being created in the future.

Example:
The "words" list contains thousands of words, ex. Apple Orange Banana

On product creation, the product would have an sku of one of the following permutations and added to a new list called "products".

AppleBananaOrange
AppleOrange Banana
BananaAppleOrange
BananaOrangeApple
OrangeAppleBanana
OrangeBananaApple

If a permutation already exists in the "products" list, then the next random permutation would be created.

This is similar to a password generator that uses words.

Thanks
 
I can't really help much with this kind of thing in Community support, but I can nudge you in the right direction.

You'd have to maintain your own table of combination already in use, and you'd need some custom code to generate the combos.

You would create your combination either as an eval'ed element default (if you want the name to be shown on the form when creating the product), or as a PHP submission script. if you do it as an element default, you would probably also want to have either a PHP submission script or a PHP validation, to make sure that you don't have a clash (two people create products at the same time, get the same combination when opening the form through the element default).

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top