A custom user type - "Store Owner" - has access to create/manage 2 types of content:
- Store (which includes a "Related Products" field)
When the user first sets up their account, they are directed to set up their store. The store is then linked (using Rules) to the user->owned_store field.
All of the above is working. Here's where I'm running into a problem:
Once a Store Owner already has a store created, they are prompted to create nodes of type "Product." I'd like to then use Rules to automatically assign the new Product to that store's "Related Products" (an entity reference field with unlimited values).
In rules, I can see "Set a data value" and, for the data selector, I can drill down to
site:current-user:field-owned-store: but inside of field-store I only see the body field. I can't figure out how to reference and add to
site:current-user:field-owned-store:related-products to add the node that the user just created.
If there's an easier way to do this not using Rules, I'm also happy to do that. But currently the only other option I can come up with is inline entity creation - but I'd rather not take users to their
Owned Store > Edit page every time they want to add a new product node.