Closed joelmeister closed 8 years ago
Mmm, that concerns me. What if we end up making products, prices, etc driven by delivery date chosen eventually? Example: they set a sale price for product X for the next 3 days. User initially chooses 2 days from now as delivery date, gets sale price, then changes to 4 days out last minute. Or if they're limiting availability of a product to a certain timeframe.
Also, if we eventually incorporate inventory, the inventory calculations will change from day to day.
I think a better option would be allowing the user to cancel their current order and start over (delete_cart).
What do you think?
Agreed. If you wanna build out a front end option for it and then just pass this issue to me I can build out a function delete_cart. It should just take 'user_id' as an option and will delete the cart_header and cart_detail entries.
Done, will need to test loading delivery options page after completion because I'm not sure if that will work OK as it stands right now. We'll see.
The cart gets deleted from the database, but then the messages comes up "No cart found for user_id: 1 You already have an order in progress."
Does the "userCart" variable need to get cleared out?
Fixed.
It would probably be nice to be able to change the cart header information/see that before you submit the order. Do you think on the add_cart_header function it should just delete the existing cart and make a new one? Or should there be an explicit update/delete function? Right now I have it coded so you just can't create a new one. I'm thinking we might want to have an update/delete so we aren't deleting things behind the scenes.