Hi,
I’m trying to figure out how to iterate through a list of things. I have a data type called “Items”, which hold the product name (of type = Product, which is another data type) and product qty (of type = number) while the user is still shopping and adding or removing items to their cart. The “Items” data type is kind of an interim table to hold what the user is adding to their cart, but not considered an order just yet (because they could remove items at the checkout stage).
Once the user clicks ‘Place order’, I’d like to iterate through each of the ‘items’ in their cart and create a thing for each item in my Orders table. I can’t seem to figure out how to iterate through a list. Any help appreciated.
An overview of my data types are as follows:
Cart
- Items (list of Items)
Item
- Product name (type = product)
- Qty (type = number)
Product
- Name (type = text)
- SKU (type = text)
…many more fields
Order
- Product (type = product)
- Qty (type = number)
- Customer (type = user)
…many more fields
Thank you.