Cart logic for a mobile app

Cart logic for a mobile app

  

Hello, I'm learning app development using OutSystems, I am trying to create an eCommerce app. 

I'm having some problems with the cart logic, I can't figure out how can I make a cart for the app, what is the logic here. 

I apologize if my question is naive but I really can't figure out what should be the logic behind the cart.

Thanks in advance.

Hi Riyad,

I assume that with "cart" you mean a virtual shopping cart that contains the items the user wishes to purchase? What exactly don't you know how to handle? What kind of "logic" are you searching for?

Kilian Hekhuis wrote:

Hi Riyad,

I assume that with "cart" you mean a virtual shopping cart that contains the items the user wishes to purchase? What exactly don't you know how to handle? What kind of "logic" are you searching for?

Hello Kilian, 

Yes I mean a shopping cart that contain the items. 

What I have problem with is the logic to implement the cart. Like should I add the product Id to a list and then display the list in the cart page, or just create a database entity "Cart" and add the products to the entity and clear it later. 

I think saving the items to a Cart entity in the database is not a good idea.


Hi Riyad,

Why do you think saving the items to the database is not a good idea?

Solution

Kilian Hekhuis wrote:

Hi Riyad,

Why do you think saving the items to the database is not a good idea?

Not only is a good Idea, as it is the common behaviour of these applications.
Otherwise, everytime you login, your cart for an unfineshed purchase would be empty, but in most online stores it isn't  :)

Solution

Eduardo Jauch wrote:

Kilian Hekhuis wrote:

Hi Riyad,

Why do you think saving the items to the database is not a good idea?

Not only is a good Idea, as it is the common behaviour of these applications.
Otherwise, everytime you login, your cart for an unfineshed purchase would be empty, but in most online stores it isn't  :)


Thanks guys I just solved it using the database method. 

Thank you for the help :)