Help Needed: How to Store Selected Answers with Prices in My Self-Service App?

Hi everyone,

I hope you’re doing well.

I really hope someone can help me because I’m feeling completely stuck right now. I’ve spent months working on this project, and I feel like I’m at the end of my rope. I genuinely don’t know how to solve this, and it’s making me panic. I don’t want to abandon the project after all this time, but I’m honestly feeling lost.

I’m currently working on a self-service app, and I’m struggling with an important issue.

Business owners can configure their menu items through the backend of my app. For each item, they can add extra questions, and each question can have multiple answer options. I have no problem displaying the correct questions for each item and the corresponding answers for each question in the order app. However, I’m stuck on how customers should select their answers and how to store them with their prices. (Each answer can have an additional price. For example, choosing mayonnaise might add $0.20 to the total.)

Issues I’m Facing:

:one: How should customers select answers?

  • Should I use radio buttons under each question to show the available answers?
  • Or should I use a Repeating Group to display answers with a checkbox next to each one?
  • The problem with the second approach is that customers could select multiple answers, while in some cases, they should only be allowed to select one answer per question.

:two: How do I temporarily store the selected answers and their prices?

  • What’s the best way to retrieve the selected answers with their price and temporarily store them (e.g., in a custom state) before adding them to the order?

Final Step: Adding to Cart

Once a customer has selected all their answers and clicks “Add to Cart”, an item is created in the cart. This item has a field called “price”, which should be calculated as:

:arrow_right: Base price of the item + Total extra prices of the selected answers.

I’ve tried so many things, but nothing is working properly, and I feel like I’m wasting so much time. If anyone has experience with this or a recommended approach, please help me! I’d be extremely grateful. :pray:

Thank you so much in advance!



This topic was automatically closed after 70 days. New replies are no longer allowed.