blathering-barnacles / Bangazon-2

Sprint 2
1 stars 1 forks source link

JB Add Product to Order #60

Closed jessicabarnett8219 closed 5 years ago

jessicabarnett8219 commented 5 years ago

Description: Added the functionality to add a product to an order(aka shopping cart). From the product detail view when the user clicks the 'add to order button', it will add the product to the user's order. I did this by creating a new view add_product_to_order which takes the product id as an argument. It checks to see if the current logged in user has an open order (order that has not been soft deleted and doesn't have a payment type). If there is an open order, it adds the product to it, if not it creates an oder first and then adds the product.

Steps to Test: Go to a product detail page (localhost:8000/products/1) Click add product to order. You should be directed to your shopping cart and see your product.

Ticket #57

Kazathur92 commented 5 years ago

It works wonders! 👍 ✌️ Great job Jess! :D