Hi everyone, I need help with implementing a discount system for my e-commerce store. Here's the flow:
Cart Page: Users can update/delete items or add a coupon. It is stored in redis.
Checkout: An order summary is displayed before users place the order.
Place Order: Data is persisted to the database, and users see the final order summary before proceeding to payment.
Discounts I want to implement:
-
First-time Purchase: Automatically apply a 10% discount on the first order.
-
Seasonal Discounts: Discounts on specific products (e.g., Black Friday – 10%, 20% per product).
The methods I've tried are too complex, fragile, and break my code. Any suggestions on how to implement this efficiently?
