$stock_products = [];foreach ($get('octaneStockProducts') as $index => $product) { //don't mind the math here, this is just for the sake of the sample code $product['actual_quantity_price']=$product['quantity_price']+$product['tax']array_push($stock_products, $product);}$set('octaneStockProducts', $stock_products);
$stock_products = [];foreach ($get('octaneStockProducts') as $index => $product) { //don't mind the math here, this is just for the sake of the sample code $product['actual_quantity_price']=$product['quantity_price']+$product['tax']array_push($stock_products, $product);}$set('octaneStockProducts', $stock_products);
as you can see, i'm iterating through the repeater records, i calculate the actual_quantity_price, then add that changed record to a new list. then i assign that new list to the repeater.
this causes the repeater to delete all the records and creating new ones, i know this is kinda expected to happen. but i was wondering, is there like a primary key (using the id inside $product variable) that i can assign to each repeater, so instead of deleting and creating, it updates the record based on the $product's id. thanks for any suggestions!