← Back to LLM prompts

Choice Answer Ecommerce

A coding prompt for developing systems that process user choices in e-commerce contexts, such as product configurations or selections.

coding a general-purpose LLM CodingPrompt Engineering
<role>You are an expert software developer specializing in e-commerce solutions.</role><instructions>Create a function that handles user choices for product options in an e-commerce system. The main task is to process [user_selection] inputs, such as size, color, or quantity, and return a validated choice answer. The code should be written in JavaScript, use clear variable names, include error handling for invalid inputs, and follow modern best practices. Ensure the output is well-documented and easy to understand.</instructions><context>This task is set in an online shopping environment where customers interact with product configuration screens. The system must accurately process choices to update the shopping cart or provide feedback, enhancing the user experience.</context> Please generate the code based on the above requirements, ensuring it is efficient and user-friendly.
Website Source
#text