Product Variation Token to fetch field of Product Display (Commerce) I am currently trying to automate some stuff, including the product sku as new products are created. For this I am using the AutoSKU module together with Token.

The idea is that every product display has a Base SKU, which I want to define once per product display.

So when you add a new variation to that product display, I want AutoSKU to also fetch whatever string has been put into said Base SKU field, named field_device_sku .


Stuff like [commerce-product:field-device-sku] unfortunately does not work, for the field belongs to the product variation's parent product display.

Is there any way pulling this off without unnecessarily redefining the 'base SKU' inside every product variation?


TL;DR: 
For pictures famously say more than 117 words, here an admin panel screeny which might make it clearer what I am talking about and struggling with:


Fetching the desired SKU of the coverage and texture is no issue thanks to taxonomy, but the base sku string I just cant figure how to get. I am starting to doubt it's even possible if it's not defined directly in the product variation.

Any help or hints would be highly appreciated!
although I solved this issue a while back just by applying the same Device term reference field on every variation form, maybe someone else happens to stumble upon this sometime:

just as I was messing with some rules yesterday, I found out about a token that deal with exactly this!
I just gave it a shot and it does exactly what I was looking for: refer to fields on the node that was used to create the variation.

the token that does this:

[commerce-product:field-product-node:0:


so, for example, the token in my case would look like this:

[commerce-product:field-product-node:0:field-device-name:field-device-sku]


(note that the screenshot in my original post is outdated, as I now determine the device name and SKU via a taxonomy term reference field-device-name)

keep in mind!:
although this may keep you from having to include the same field on the product variation, I reckon this is less reliable. you may run into trouble, if you happen to create (or edit!) a product variation from a different node that does not have the reference field (or has other input). note that even when editing an already existing product, the SKU will be re-generated on submit. so make sure you only edit the product from within the original node (or any node that has the same field with the same value), if you dont want the value of the token-generated field to change.

however, I could be wrong and it may be just as reliable, if the field-product-node:0 always references to the same node on which the variation was originally created, regardless of where you edit it later on. – someone will have to test this (and preferably report back) if he/she is interested in the exact behavior of this node reference token.
if anyone knows the answer, I would be interested in hearing how this behaves exactly. but since I'm sticking with the extra field in the variation, I do not rely on this method now.

hope this helps someone else in the future. (: