Basically, the user inputs a value from 1 to 5 on these specific vegetables, and then on the right the top 3 will appear.
I’ve been able to store the inputs on the DB, but not so lucky at displaying the top3. And I’ve tried multiple ways with the database, all together, separate, linked. But did not work.
Can someone explain to me what I’m doing wrong?
Is it the database, or logic?
And this is how I’ve structured the DB, basically retrieving the inputs (scores) of each vegetable, which also poises a challenge to later display the name in the right i.e Carrots 5 (I think )
Dealing with ranges is certainly trickier. Perhaps it would be better to change the scores to type number
I see this functionality resembling how a shopping cart works. You choose products and create line items in an order. 3 dataBase objects involved. The lineItem holds the chosen quantity of the product.
Try and see if the above can be adapted to how you want things to work in your dB model
I’ve tried with numbers, instead of range but it did not work.
This is - I’m able to retrieve the data and store the scores as numbers on the DB.
However, the challenge is putting/displaying the scores in the RG in order with the name of the vegetable attached.
I’ve tried to divide the two data types (vegetables and scores), but it also did not work.
But what you are suggesting is to create:
data type - vegetables (name)
data type - scores (score - how do I connect it to each specific vegetable)?
user enters a quantity for his/her preferred products
he/she can click a button that says “cart”
onCartButtonClick create a cart and right after use the non-empty scoreInputs to create the respective lineItems recursively and relate them to the cart
add those lineItems to the list of lineItems in the cart
The above names resembling a cart experience are for illustration purposes