On insert, update form repeat fields (from autocomplete input)

Hey guys,

I’m trying to make my ordering system to work and I need an advise please.
I have the basic fields of my orders page ( date, client, etc…) and I have a from repeat to insert the products that are included in each order. I used a from repeat for this.

I have an autocomplete input (inp_ord_prd_Prd_id) to search/select a product. Its data comes from a SC srvc_productSearchList (auto-load).
When this is selected (dmx-on:changed) an other SC srvc_getProdDetails (no auto-load) is loaded and on srvc_getProdDetails on-success event, I want some of the other fields of the form repeat to be updated from the SC data that is loaded based on the value of the autocomplete input value.
I started this and had in mind (like I do with form repeat UPDATE) to have a hidden input in my form repeat that stores the line index so I can pass it when values are changing to keep updated every product line (form repeat record).
No $index available in form repeat so I can bind the values when my SC srvc_getProdDetails is loaded… When a product line is updated, all the lines of products are updated with the same value…

What am i doing wrong? Maybe the way to work with this structure is to go with 2 dimension array on client side, if yes how to declare a 2 dimension array values?

(I am confused… Sorry for the stupid questions)

If somebody has to point me a direction or advise me on how to work on it would be great help

Thank in advance
Tasos

I just ignored that I’m talking about a cart, so probably this is the way to go…
Creating a Shopping Cart with the Data Store Component - Docs / Cookies, Sessions and Local Storage - Wappler Community

Right?