I am half way through implementing a marketplace solution and I am after something to keep the SKU's my users create of a standard format so we can spot from a high level who the products belong to... after an sku like [store-name]-product-[product-id] or something like that.

My first attempt was well rules should do this right? Well not really when using the before save event on the product create I can set the SKU but only altering a entered result.. ie we have to populate the field, then I can alter it out.. missing somethings like content-id as well its not yet created but I think I could work with this if there is a way to stuff the field and alter it out via this rule.

Else there is another solution I really like http://drupal.org/project/field_validation field validation via some regular expressions, that would work as we can force the pattern we want. But that field is not editable and hence we cant put the field_validation module on the field.... Might be an option down the road to implement something like this for custom product fields.. think many people can benefit from this as stores tend to follow some in-house naming conventions.

I know there is work happening around token in commerce, so I would just like to get some more info on what would be the best approach here?
What should I be aiming for down the road?

Comments

tr’s picture

Status: Active » Closed (duplicate)

This is also discussed in #733332: Complete Token support for Product SKUs. There is code for Auto SKU in that issue.