oc-mall-plugin
oc-mall-plugin copied to clipboard
New Discount System
Currently, the discount system can only be used for a handful of scenarios and will apply a discount to the whole cart. I would like a discount system in which we have more options and/or can extend the system to include our custom rules.
I know there already are ideas for a new discount system and I want to use this issue to collect all the needs and ideas that others have. So please share your opinion!
At this moment I have seen the following discussions: #157, #304, #306. There are different ideas on how to improve the discount system from which I think we need at least:
Being able to apply discounts to different entities
- [ ] Apply a discount to products
- [ ] Apply a discount to categories
- [ ] Apply a discount to brands
- [ ] Apply a discount to a whole order
- [ ] Apply a discount for a specific user
Being able to apply discounts in a certain timespan
- [ ] Valid from date
- [ ] Expire date
Being able to extend discount logic
- [ ] Extend when a discount is applied
- [ ] Extend how a discount is applied
Personally I think the extendability of the discount logic is the most important. We could use this to (re)implement current/new/custom functionality.
for a client, we need to apply discount to a shipping
and also combination as for this brand for this shipping for this category
I need to develop this discount rules for my client asap, I will look to a way to hook into the existing Mall Discount Engine
@tobias-kuendig for the time being, would it be possible to add some events around the application of discounts? that would help to extend the current discount system I think
Yes, of course! What do you need?
mmm I didn't yet look into the discount thing. I just remember a discountapplier class. Where would that make sense to add an event? in the TotalCalculator maybe before and after the discount applied?
Maybe you can extend the 'Valid if' field of a discount to add your custom rule in the select with for example 'custom_trigger'. Then you would need an event in DiscountApplier->discountCanBeApplied() to handle when you want your 'custom_trigger' to be triggered.
You could do the same for the discount type if you need other logic for how the discount is applied by extending the discount type field of a discount with for example 'custom_type'. Then you would need an event in DiscountApplier->apply() to handle your custom case for calculating the savings and reducedTotal. To include your custom triggers you can add an event to TotalsCalculator->applyTotalDiscounts() in which you can add your custom triggers to be fetched when checking for available discounts.
This is just some quick thinking and I'm sure I forgot something, but I hope this will help you.
Any news about the new discount system?
@alex-mokkas At the moment we are not actively working on this.
Hi guys, I have a client who asks me about volume discounts. "When a certain product has been entered X times in the cart, the product price should lower to a discounted price." Would this be in the roadmap for the Mall-plugin? And if not, would it be realistic to build myself? Thanks!
A feature like this is definitely on the roadmap but we are probably talking about many month until it lands.
Adding it yourself is possible, but it might need some work. Also, there are probably not enough events around you can hook into. But we're open to add more events to make the plugin extendable.
Maybe start by looking a the DiscoutApplier class. There you could be able to hack something together.
just an idea: one easy way maybe could be to allow the possibility to register a new DiscountApplier class for now, which will allow us to provide anything.
Hello,
We definitely need a complex discount mode soon. We don't have enought knowledge of mall to handle this by ourself yet, but we are OK to sponsor the development.
Is somebody interested ? What would be the price for that ?