Final Major Project — Finishing Ordering System
I want my application to be in a condition for the deadline that no matter what the user does they can’t end up in a situation where it looks like the application isn’t performing as it should be. In order to address this I began working on the ordering page again, currently once a user has placed one order the application can handle that fine however if they place another order from the same shop it adds it onto the end of the order and duplicates the pricing and if a user places an order from 2 different shops the orders clash resulting in some of the content from just one order being displayed like the shop name.
To tackle this issue I decided to change the way the ordering page works so that a user can have multiple current orders running side by side and can view the separate orders by navigating between them. To tackle this issue I had to change the way in which the application reads the orders from firebase, instead of directly read what is there and just showing it on the page I decided that the application will have a look at all of the orders that are currently adtive for the user and then push these orders into an array. The orders page checks the array and looks at which order is in position 0 in that array and shows just this order first by default. This fixed the isses with clashing orders and by pushing them into an array and also adding in the ID of the shop that the order was from it stopped the orders from clashing as each order as a unique identifier yet I can still find out which shop it is ordered from by accessing the shop ID in side the array.
It is actually fairly unlikely that a user would have multiple orders running at the same time but it is possible and as currently there is no way to edit or cancel an order and it’s unlikely I’ll have time to implement these before the deadline it seemed a sensible way of getting around the fact the multiple orders would cause the app to look extremely buggy and will work much better for demonstrative purposes.