Add stock field to product display containing multiple SKUs I've been trying forever to create a stock field for a product display that contains multiple product skus. I want to do this so that when each variation is purchased, it is subtracted from the total number of items in stock. Commerce Stock seems to let you track stock for individual skus, but not for one product with multiple skus. For example, I have a total of 100 shirts, but 10 shirts are pink, 10 are red, 10 are blue (hence, the different SKUs). That said, when 2 blue shirts have been purchased, I want the stock to drop from 100 to 98 on the product display. Out of the box, this isn't possible. 

I tried using the answer in Synchronize commerce stock for product variations, but I'm unable to achieve the same result. I created a master stock text field on the product display, but I can't seem to set rules to subtract from the new field. Does anyone have clear instructions for doing this via rules?

In short: I am looking for a simple way to synchronize all product variant's stock in a single product display.

** UPDATE

I have SUCCESSFULLY obtained the nid of a product display, and then, fetched Product Display by that nid with the below rule settings. That said, when I try and add an action to set data for my custom stock field (product_stock) located on my content type Product Display, rules can't seem to find it? How is this happening?



FETCH ENTITY BY ID SCREEN



THE SELECTORS I DO GET WHEN I DO FETCH ENTITY BY PROPERTY:
First, you will need to add an entity reference field to your line items. This will reference the product display node.

Then using Views Rules create a line item view with a "Rules Display" 


For "contextual filter" add Order ID.
For "fields" 


Add the quantity 
Add Node ID (nid) of the referenced Product Display Page.



Now in your rule simply add a view loop and pass the Order ID as a parameter. 

Inside the View loop:


Fetch entity from ID, pass the NID from the view result.
Do Calculate a value. Get the fetched entity quantity -  view result quantity
Set a data Value for fetched quantity field, calculated value.