Possibly related, Adam Wathan gave a talk using discounting code as the base at laracon eu : https://www.youtube.com/watch?v=5DVDewOReoY . It might be of interest :-)
Oct 16, 2015
3
Level 3
The discounts system for e-commerce project
Hello there. I am building e-commerce project. This project has a discounts system with different discounts.
There are three kinds of discounts:
- - PersonalDiscount
- - OrderTotalSumDiscount
- - PromocodeDiscount
I am looking for the best practices to organize this discount system. I'm considering a few variants of design patterns: Strategy, Decorator, Chain of responsibity.
The one important thing is that every discount systems could has some conditions of using:
For example if total price of order more that $2000, apply the discount, etc.
Could anybody advice me some solutions about this task. I would be happy to hear from you various options.
The database structure: http://joxi.ru/Vm6bXo3hGvjVmZ
Thank you for your answers.
Level 50
2 likes
Please or to participate in this conversation.