Shopping Cart with Customizable Products

Hi @juan.roberto.garzon! :slight_smile: Merry Xmas to you too! I think Gaby’s posts here describe the best way to approach it:

For example, you could have three ‘Types’: Pizza, Topping and Cart.

Pizza
Toppings (type: Toppings, list: yes)
Size: (Small, Medium for example) (type: text, list: no)
Total (type: number, list: no)

Topping
Name (type: text, list: no)
Price (for that topping) (type: number, list: no)

Cart
List of Pizzas (type: Pizza, list: yes)
Total Price (type: number, list: yes)

Each ‘Pizza’ can have its own list of Toppings. The User’s cart can contain a list of Pizzas (since a User can order multiple Pizzas). As Toppings are added or removed from their parent Pizza, their parent Pizza’s ‘Total’ field should update to reflect what the total price for that Pizza is.

The Cart’s Total for all Pizzas in its Pizza field be “This Cart’s Pizza’s Total: sum”. That expression would give you the :sum of all Pizzas’ Total fields, within the User’s Cart.

I think that would be one way to do it :slight_smile:

2 Likes