oc-mall-plugin icon indicating copy to clipboard operation
oc-mall-plugin copied to clipboard

New Discount System

Open Pindagus opened this issue 4 years ago • 14 comments

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.

Pindagus avatar Nov 12 '19 15:11 Pindagus

for a client, we need to apply discount to a shipping

chrisvidal avatar Nov 14 '19 07:11 chrisvidal

and also combination as for this brand for this shipping for this category

chrisvidal avatar Nov 14 '19 07:11 chrisvidal

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

chrisvidal avatar Nov 14 '19 09:11 chrisvidal

@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

chrisvidal avatar Nov 15 '19 01:11 chrisvidal

Yes, of course! What do you need?

tobias-kuendig avatar Nov 15 '19 06:11 tobias-kuendig

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?

chrisvidal avatar Nov 15 '19 07:11 chrisvidal

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.

Pindagus avatar Nov 15 '19 08:11 Pindagus

Any news about the new discount system?

alex-mokkas avatar Sep 14 '20 13:09 alex-mokkas

@alex-mokkas At the moment we are not actively working on this.

rubenvanerk avatar Sep 14 '20 15:09 rubenvanerk

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!

chocolata avatar Nov 04 '20 10:11 chocolata

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.

tobias-kuendig avatar Nov 16 '20 07:11 tobias-kuendig

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.

chrisvidal avatar Nov 16 '20 08:11 chrisvidal

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 ?

PubliAlex avatar Jun 24 '21 09:06 PubliAlex