To automatically delete the product displays when a product is deleted, is a feature of the module Auto Product Display, but I don't need that module.
Preferably using the Rules module, I would like to accomplish the same. An issue in drupal.org is present, but currently open.
I'm trying to fetch the referencing product displays:
Trigger: After deleting a Commerce Product
- Fetch entity by property
- Entity is of type: node
- The property by which the entity is to be selected: product (the product reference field)
- The property value of the entity to be fetched: ?? (The node ID of the product is not available to select)
How to get the node ID's of all product displays referencing the product?