Download & Extend

Using token to generate product title

Project:Commerce Kickstart
Version:7.x-2.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I'm trying to use AutoSKU to generate the SKU.This works really well but I can't use the product_display name to do so, there is no token. I have to use the product-title token and use the auto generate product title (On Inline Entity Form) which uses the product display names.
Unfortunately, the generated title append the value of the attributes but I want the bare one.

Example

I want my SKU to have a dash between the product name and the color (that's how the SKU are, I can't change it)

it looks like this

product-black.

I configure AutoSKU this way :

[commerce-product:title]-[commerce-product:field-colour]

What I get is
productblack-black instead of product-black

(productblack is the title generated by 'Inline Entity Form').

I can either
- enter the SKU manually (this dismiss the use of AutoSKU)
- enter the product title manually (this dismiss the use of 'auto generate title')
- unset my color field as an attribute whilst I'm entering new product (I'll endup forgetting and having wrong SKU)
- patch commerce_product.inline_entity_for.inc to no use attributes (that's what I do, not great)

Alternatively, having either a product_display token in the AutoSKU
or (probably better) be able to configure the generate title using Token would solve the problem nicely.

Comments

#1

did you try Automatic Entity Label - http://drupal.org/project/auto_entitylabel ?

Here is a topic for Auto generate the product title : http://www.drupalcommerce.org/comment/5619#comment-5619

of course this could be done also with custom Rules with set value actions for both Product titles and SKUs.

#2

No I haven't tried, just using the normal autosku module.
I've given up anyway in using it. I'll create sku externally and import them with feeds.
However, I still think autosku would benefit from having access to the product display (and its token).

nobody click here