Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a customer I want to be able to add products to a cart so that I can purchase multiple items at once #69

Open
1 of 3 tasks
valincius opened this issue Oct 28, 2021 · 6 comments
Labels
api anything related to the back-end razor anything related to the razor pages user story Describes an project-spanning user story
Projects

Comments

@valincius
Copy link
Member

valincius commented Oct 28, 2021

Given I am a customer
When I view the product list
Then I can choose a quantity (1-99) of any product
Then I can add multiple products to a cart

@valincius valincius added razor anything related to the razor pages user story Describes an project-spanning user story labels Oct 28, 2021
@valincius valincius added this to To do in Front End via automation Oct 28, 2021
@valincius valincius added api anything related to the back-end razor anything related to the razor pages and removed razor anything related to the razor pages labels Oct 28, 2021
@ofu997 ofu997 self-assigned this Nov 14, 2021
@ofu997
Copy link
Contributor

ofu997 commented Nov 14, 2021

I can try this issue, but currently getting this: SocketException: No connection could be made because the target machine actively refused it.

HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:44388)

@valincius
Copy link
Member Author

You need to run the front end and api projects at the same time. You can do so by setting multiple startup projects in VS or by launching both projects manually. @ofu997

@ofu997
Copy link
Contributor

ofu997 commented Nov 16, 2021

Tried starting a nonasync method to handle a cart object, which resulted an object instance error since the page expects there to be a Model.Products property. Is there a way to include multiple page-handlers in the same form, since this would go with the existing OnPostPurchase ?

@valincius
Copy link
Member Author

That OnPostPurchase was Ok because we the user didn’t need to stay on the same page. We want them to stay on the products page now, so you’d probably want to use JS (fetch) to send the request instead of posting it how we’re doing now.

@ofu997
Copy link
Contributor

ofu997 commented Nov 20, 2021

https://learningprogramming.net/net/asp-net-core-razor-pages/build-shopping-cart-with-session-in-asp-net-core-razor-pages/

An approach I found that uses CartItems as the model behind a Cart page. Downside is that selecting the quantity of items will not be on the Products page.

@valincius
Copy link
Member Author

valincius commented Nov 20, 2021

Well we will want something like that for the cart page, but here we want this similar functionality on the products page.
If you need some guidance you can PM me on discord and I can try walking you through what’s needed here. Should be relatively simple. @ofu997

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api anything related to the back-end razor anything related to the razor pages user story Describes an project-spanning user story
Projects
Development

No branches or pull requests

2 participants