How to make a shopping cart?
Application Type
Traditional Web

Hey!
I was making an app for my dad (who has a store) and I am trying to build a shopping cart.
Yesterday I whatched a video but in the video, he was only adding 1 item at a time to each package.
Imagin that he had the Product X, Product Y and Product Z. He was only adding 1 Product X and in another package 1 Product Y. I want to add 5 Products X, 8 Products Y an 1 Product Z all in the same package(imagine).

Any good tutorial, any good tip?

Tnx in advance

mvp_badge
MVP

Hello Tiago.

Welcome to OutSystems.

I think what you missed was a quantity attribute on the cart. You add 1 product by default, but you may want to increase the quantity.


There are a few examples on the Forge. You can look and take ideas from them https://www.outsystems.com/forge/list?q=commerce


Hey! It really dint help because there was only one that I was able to Download and see. It was the one with the most downloads.
I saw the logic and the entities but i did not understand because I was not able to test as user buying products. What I understood is that I need to entities, at least. One for the products and one for the PurchaseOrder. Is that correct?
If yes, when I go to the entity PurchaseOrder to see the data, it was no Data about the products ( Which onesI ordered, it has the amount only). So, how do I knowwhat I ordered?

mvp_badge
MVP


You have an entity Product: Id, Name, Price, etc.

You have a PurchaseOrder: Id, ClientId, CreationDate, StatusId

And the PurchasePrder will have a details/lines entity with the following attributes:

PurchaseOrderDetails: Id, OrderId, ProductId, Quantity

Do you have a diagram of your data model?

For now, I only created the product entity

mvp_badge
MVP


You need to build the model with a Cart or Order entity. Personally, I think Order is enough for the online shop scenario.

Take a look on Gonçalo's suggestion. I haven't tried that one but is very recent so it probably works fine.

Hi Tiago

Check this app: https://www.outsystems.com/forge/component-overview/10481/item-shop

It's for mobile, but it's easy to understand.

Regards

Gonçalo Almeida

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.