Cart option Related

Hi all, im creating a sample e-shop application now. i have products list screen and add new products details screen also. now i want to create cart screen for checkout customer selected products with bill, sales records screen and also want to download sales report.. how can i do ??

Solution

1 question

For the cart screen, you will need to have an entity that makes the N-M

I have also created a screen to add the products to the cart of the customer that is using your app.

In this image, you can see a table, the list of products and a checkbox for each product

To have the checkbox to select the product that I want to put to the cart I have to create a structure to include that.

To save the select products. You have first to save the products to a local variable(list) with the products. In this way, everything will be connected

To save the products you have to create a server action that will loop the select products.

I have created a save button that will call that server action.

The server action will have as inputs the local variable with the products and the User id of the customer that is adding products to his cart

Inside of the server action, you will have the for each that will interact and see which of the products was selected. If so, I add to the local variable of the server action the user id and the product id and I save it on the create cart action that will save on the cart entity that I said that created to save the products of the user on a cart. Also, I have created a cart parent that will hold the Carts.



ps: I will edit this comment by the time I am finishing each task. I am just doing this to not lose my report. I will notify you when finishing

2 question

To display the bill and to show the cart. I have created a screen. On this screen you can display the cart and also, you can delete products that you don't want.

You will notest that I use data actions. why? Because when you use aggregates you must put max records, and you want to display everything. So on data actions, you don't need to include max records.

On this data action, I include the products selected by the User

And I also do a calculation of the bill by summing the price of each



Question 3

To get the sales we are going to use the entity that I created to list all the carts for that User


Question 4

 I have created a server action to download. So I have the input with the data to download and I retrieve using an output that will give me the binary data to download.

Then, with the output from the server action, I use the download widget as you can see and that's it

To create a cart: https://marcio-carvalho4.outsystemscloud.com/TrendyMart/CartScreenAddProducts?_ts=637749342214356724

To See your cart:

https://marcio-carvalho4.outsystemscloud.com/TrendyMart/MyCart?_ts=637749342298213285

Report Screen:

https://marcio-carvalho4.outsystemscloud.com/TrendyMart/ReportSales?_ts=637749402271430593

Hope it helps you

Sorry for the delay, but I found some bugs and I spend a little more time :D


Hey @Sugan J, first you need to separate that into different tasks and different questions. If you want to do everything and think about everything, it's going to be more difficult. I am just saying this because of my modest experience.

1- create cart screen for checkout customer selected products 

2- Display Bill of the products selected

3- Sales records screen 

4- Download sales report

Also, if you could provide an OML with what you have to see the big picture it would be great or a sketch of the things you want.

1- you will have to display the products and have the checkboxes to select the products, then you need to think about the entity that will save for each user the products selected

2- the bill it will be shown after you select the products. by selecting you can sum the prices by the quantity and possibly you will need to save the bill on the database

3 - I don't understand what you want

4 - basically if you have it saved in the database you can list it download to excel if is that what you want(you didn't say in the description of this question) and then you have your binary data with the sales report and then you can use the download on client-side.

You can have an idea of what you want by seeing this app on forge-

https://www.outsystems.com/forge/component-overview/4962/shopping-list

Kind regards,

Márcio

Yes bro exactly this is i want bro.. Please help in this.. i have only downloaded my oap file. i dont know how to download oml file.

BuyMe Super Mart.oap

https://www.outsystems.com/forums/discussion/56928/how-to-generate-an-oml-file/

Here you go. Have a look

Can you explain point 3? what do you want with a sales report screen?


Replying to Márcio Carvalho's comment on 12 Dec 2021 16:17:2 In reports screen i want to show all the order reports thats mean cusomers orders.. if i want that order report i could dowload it.
TrendyMart.oml

https://youtu.be/TFdpA1TT0mk

i Did my application with help of this youtube video but its not fullfill my requirements bro.

Solution

1 question

For the cart screen, you will need to have an entity that makes the N-M

I have also created a screen to add the products to the cart of the customer that is using your app.

In this image, you can see a table, the list of products and a checkbox for each product

To have the checkbox to select the product that I want to put to the cart I have to create a structure to include that.

To save the select products. You have first to save the products to a local variable(list) with the products. In this way, everything will be connected

To save the products you have to create a server action that will loop the select products.

I have created a save button that will call that server action.

The server action will have as inputs the local variable with the products and the User id of the customer that is adding products to his cart

Inside of the server action, you will have the for each that will interact and see which of the products was selected. If so, I add to the local variable of the server action the user id and the product id and I save it on the create cart action that will save on the cart entity that I said that created to save the products of the user on a cart. Also, I have created a cart parent that will hold the Carts.



ps: I will edit this comment by the time I am finishing each task. I am just doing this to not lose my report. I will notify you when finishing

2 question

To display the bill and to show the cart. I have created a screen. On this screen you can display the cart and also, you can delete products that you don't want.

You will notest that I use data actions. why? Because when you use aggregates you must put max records, and you want to display everything. So on data actions, you don't need to include max records.

On this data action, I include the products selected by the User

And I also do a calculation of the bill by summing the price of each



Question 3

To get the sales we are going to use the entity that I created to list all the carts for that User


Question 4

 I have created a server action to download. So I have the input with the data to download and I retrieve using an output that will give me the binary data to download.

Then, with the output from the server action, I use the download widget as you can see and that's it

To create a cart: https://marcio-carvalho4.outsystemscloud.com/TrendyMart/CartScreenAddProducts?_ts=637749342214356724

To See your cart:

https://marcio-carvalho4.outsystemscloud.com/TrendyMart/MyCart?_ts=637749342298213285

Report Screen:

https://marcio-carvalho4.outsystemscloud.com/TrendyMart/ReportSales?_ts=637749402271430593

Hope it helps you

Sorry for the delay, but I found some bugs and I spend a little more time :D


TrendyMartMarcio.oml

thank you so much for the effort friend.. but while i publishing your OML its not opended in browser.. My previous OML is updated with your sent oml in my environment

Screenshot (8).png

Hi Sugan,

I think it's better to check error log from Service center first. If you are not sure what is the issue from error log you can post it in here then Marcio or others can help.

Regards,

Khuong

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