Collect data from input text in RG by OPSET

This can be a little confusing, so i will try to explain in baby steps.

I am making a mid-complex level e-commerce site for custom printing.

What i am trying to achieve:

for customers to easily input the quantity of each item through RG. (see image below)

image

as you can see, all the sizes are layer out, I want the customers to put numbers and then press add to cart and it automatically saves into the thing (database).

This is what I have created up till now

I have a data type of products, for products with sizes as OPSET. Because some products will have limited sizes, so it is faster to use OPSET and choose the correct sizes for each product when adding a new product. for example: item 1 will only have sizes from S to L, and Item 2 will only have sizes from M - 2XL…

So in the repeating group, it is listing all chosen sizes for specific products correctly. I have added an input box as well, so that repeats for each size correctly.

Here is what is happening

So to keep things simple I created a new Data Type, called ‘Cart-Product’ which has All the sizes fields. i.e. S, M, L etc…

I just want to retrieve the quantity number that the customer has put in the input box for each cell and populate it in the datatype for each of the correct fields in the datatype.

for example: if the cell is for S then the input box should shave the quantity of S to the ‘S’ Datatype.

Here is what I created

In workflow when I created an action when I press the ‘Add to cart Button’ this is what I have (see below).

(the temp-customer is just for cart functionality, ignore that, purely because I can’t get my head around cookies)

This is populating into all datatypes, but it is replicating the same number for all the fields.

I am so stuck with this, doe anyone have any ideas please?