# Create a shopping cart and a record of those sales by users / Crear un carrito y un registro de esas ventas por usuario

**URL:** https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242
**Category:** Ask for Help
**Created:** [January 29, 2023, 7:36pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242 "2023-01-29T19:36:12Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [January 29, 2023, 7:36pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/1 "2023-01-29T19:36:12Z")

</div>

Hello!

I am building a web app to manage recipe expenses. There is an ingredients database with name, category, and price. I need to be able to generate a recipe by adding quantities and getting a total (like a purchase). I also need these recipes (purchases) to only be visible to the user and for them to be able to add their own ingredients with their prices. I have everything advanced but I can’t get the “costs” of the recipes (sales). Can anyone help me?

–  
Hola!

Estoy realizando una web app para gestionar gastos de recetas. Hay una base de datos de ingredientes con nombre, categoría y precio. Tengo que ser capaz de generar una receta añadiendo cantidades y que me haga un total (Como si fuese una compra). También necesito que esos recetas (Compras) solo puedan ser vistas por el usuario además de poder añadir sus propios ingredientes con sus precios. Tengo todo avanzado pero no soy capaz de sacar los “costes” de las recetas (Ventas). ¿Alguien me puede ayudar?

---

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [January 29, 2023, 7:45pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/3 "2023-01-29T19:45:15Z")

</div>

Hola!

Tienes que usar **User-Specific column** para individualizar la gestión de las recetas por usuario y así puedas tener luego el costo de cada receta hecha por c/u.

Empieza por aquí [Glide Docs • User-specific columns](https://www.glideapps.com/docs/reference/basic-columns/user-specific-columns)

Saludos

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [January 30, 2023, 12:27am UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/4 "2023-01-30T00:27:40Z")

</div>

I think you would need 3 tables for this.

**Ingredients table:**

| RowID | Ingredient Name | Price |
| --- | --- | --- |
| Ingredient001 | Flour | $0.50 |
| Ingredient002 | Sugar | $0.75 |
| Ingredient003 | Eggs | $2.00 |
| Ingredient004 | Milk | $1.50 |
| Ingredient005 | Butter | $2.50 |
| Ingredient006 | Cocoa Powder | $3.00 |
| Ingredient007 | Bananas | $1.00 |

**Recipes table** :

| RowID | Recipe Name | Email |
| --- | --- | --- |
| Recipe001 | Chocolate Cake | [chef@example.com](mailto:chef@example.com) |
| Recipe002 | Banana Bread | [chef@example.com](mailto:chef@example.com) |

**Recipe Items table**

| Recipe ID | Ingredient ID | Quantity |
| --- | --- | --- |
| Recipe001 | Ingredient001 | 1 |
| Recipe001 | Ingredient002 | 1 |
| Recipe001 | Ingredient003 | 2 |
| Recipe001 | Ingredient004 | 1 |
| Recipe001 | Ingredient005 | 1 |
| Recipe001 | Ingredient006 | 1 |
| Recipe002 | Ingredient001 | 1 |
| Recipe002 | Ingredient002 | 1 |
| Recipe002 | Ingredient003 | 2 |
| Recipe002 | Ingredient004 | 1 |
| Recipe002 | Ingredient005 | 1 |
| Recipe002 | Ingredient007 | 2 |

I imagine the flow would be:

- The users should be able to add ingredients to the ingredients table, but ideally, you would have to check for duplicates, and make sure the prices are right.

- The users should be able to add recipes to the recipes table, and you should be able to collect the user’s email/rowID when they do so.

- In the details view of each recipe, allow users to add items to the recipe using a form. You should collect the ingredient’s ID, quantity, and write the recipe ID alongside those to the Recipe Items table.

- In the Recipe Items table, create a relation from the Ingredient ID to the RowID column of the Ingredients table. Return the price of each ingredient through a lookup column. Add a math column to return the cost of each row (price x quantity).

- Create a relation from the Recipes table to the Recipe Items table (RowID \> Recipe ID), make it a multiple match, and then use a rollup column to sum the “cost” of all related rows. You should get the cost of each recipe.

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [January 30, 2023, 5:08pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/5 "2023-01-30T17:08:28Z")

</div>

Perfecto! Lo voy a intentar y te cuento de vuelta. Gracias!

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [January 30, 2023, 5:09pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/6 "2023-01-30T17:09:16Z")

</div>

Ok! I will try and let you know! Thanks

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [February 10, 2023, 1:22pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/7 "2023-02-10T13:22:05Z")

</div>

Finally I used one Glide Official tamplate to make It. Thanks!

---

<div class="post-metadata">

### Author: ![Manikandan\_R](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manikandan_r/32/43482_2.png) [@Manikandan\_R](https://community.glideapps.com/u/Manikandan_R)
#### Post date: [February 10, 2023, 3:19pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/8 "2023-02-10T15:19:30Z")

</div>

Which glide official template you used ?

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [February 16, 2023, 2:53pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/9 "2023-02-16T14:53:07Z")

</div>

This [Glide • Coffee Shop Business Template – Coffee Shop Business page](https://www.glideapps.com/templates/coffee-shop-business-pb)

But now im trying to set all login system and personal recipees and it is becaming imposible. I had all system created. You can login and make recipes, add ingridients, updates costs… but if one user change one price, this change for all users.

I know I need get ID per new row. I shaw all official an unofficial glide tutorials and I couldnt. It is becaming frustrating.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [February 16, 2023, 11:54pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/10 "2023-02-16T23:54:32Z")

</div>

> [@Jon\_Hernandez\_Iriond](#):
>
> but if one user change one price, this change for all users.

So you allow prices per user? Were it me I would have allowed them to add their own ingredients instead of using a public pool of ingredients if you allow users to change the price, then use row owners so they will only load their own rows.

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [February 19, 2023, 12:49pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/11 "2023-02-19T12:49:36Z")

</div>

Yes. I know but I cant launch ID per user. Maybe I need start the project from 0.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [February 19, 2023, 2:39pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/12 "2023-02-19T14:39:25Z")

</div>

> [@Jon\_Hernandez\_Iriond](#):
>
> I know but I cant launch ID per user.

Can you specify why this is the case?

---

<div class="post-metadata">

### Author: ![Jon\_Hernandez\_Iriond](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jon_hernandez_iriond/32/53197_2.png) [@Jon\_Hernandez\_Iriond](https://community.glideapps.com/u/Jon_Hernandez_Iriond)
#### Post date: [February 20, 2023, 12:30pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/13 "2023-02-20T12:30:15Z")

</div>

I am not sure why I cant. I can send you a video if you want

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [February 20, 2023, 2:07pm UTC](https://community.glideapps.com/t/create-a-shopping-cart-and-a-record-of-those-sales-by-users-crear-un-carrito-y-un-registro-de-esas-ventas-por-usuario/57242/14 "2023-02-20T14:07:16Z")

</div>

Please record a Loom video and give us the link in this thread.
