1
Answers
How to get product SKU from order in rules?
When a order is paid I successfully create a custom content type the buyer has to fill out. This newly created content needs a reference to the bought product.
I try doing so using a "set a data value" action but can't figure out how to get the product reference from the commerce-order. Data selector shows "commerce-order:commerce-line-items:" but no reference to the product.
Seems quite basic but I couldn't find any documentation on that.
Comments
How do you check for a products field using data comparison? I can't find a way to do this - the product doesn't show in the data selector at all under order or line items.
I answered my own question. Use "Entity Has Field", choose "commerce-order:commerce-line-items:0" and the field "commerce-product". The fields in product (like SKU) are now available to any actions.