Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Exclude specific catalog entries from a Promotion

$
0
0

Hello everybody,

A customer I'm working on has for a while asked us to implement a feature where they can create a promotion, select which content they want to be the condition and then select some content that should not be a part of the promotion. I've not really theorized a solution for this, so we've done some workarounds that worked well enough to fulfill the use case they had. However, I want to reach out and see if someone can help me suggest a way of implementing this nicely.

Before anyone asks "Why not just include what should be included in the promotion?", I think I'm safe to say a very common usage of promotions is have one that affects the entire assortment or large portions of it, but that a few products are too "premium" to be affected by a discount.

Way 1: The obvious way

Create a custom promotion processor for the promotion. You can do whatever logic you want from in there, right? Well, this feature should be for all promotions, so that'd mean we'd have to create a custom promotion for every existing built in promotion. A class that inherits the data class for that specific promotion adding the list of exluded content and a processor that overrides the old promotion processor and somewhere injects the logic to exclude the products selected in the list of excluded content. 

So in the end the solution is quite ugly, will have to mean creating tons of code that "already existed" and if Epi releases a new promotion implementation, we will have to manually build that one as well.

Way 2: EntryFilterSettings to our rescue?

The fairly new way of excluding products from promotions, does look very promising, just by looking at the description. However it doesn't fit this use case, as this should be promotion specific. Maybe promotion A should exclude product P1 and promotion B should exclude P2. We can't solve that by the EntryFilterSettings, since that one is used in the promotion engine, removing the items before the engine starts running the specific promotion processors.

So this method is unfortunately a no-go. Even though we do use EntryFilterSettings for a lot of other purposes, such as always excluding gift cards from promotions!

Way 3: Make Epi implement a way!

innocent

In all seriousness I'm looking for a way of implementing this. Am I missing something, am I tunneled visioned and there is an super easy way of achieving this? Currently I'm leaning to implementing it as Way 1, but not super excited about it. 


Viewing all articles
Browse latest Browse all 9076

Trending Articles