Replies: 9 comments 22 replies
-
This would be wonderful to have in the Sylius core. I would love to help everything I can. So first of all your use case is too simple to actually outline the 'real' difficulties with catalog promotions: Here is a more complex use case:
What are your internal thoughts on this? Is this something you want to handle in the first version of this feature? I have a few ideas on how I wanted to tackle this in my own plugin, but I think it would be great if we handled it in the core if you're up for it :) |
Beta Was this translation helpful? Give feedback.
-
If we want to keep the actual promotion behaviour and just add a new capability :
Or we can imagine a dedicated page in the admin allowing to choose what will be inside this
The rest is an extensive use of the I never used promotions from other products than Sylius so maybe there is better ideas than this one. |
Beta Was this translation helpful? Give feedback.
-
Based on the answer from @CoderMaggie here are a few opinions:
With this setup there is still an obstacle: How do we know or how do we decide when to update/assign catalog promotions? If we did it every time a catalog promotions was created it could easily be that it would run 10 times in a row (because the administrator updated/created 10 promos). And what about product changes? The rules would most like be affected by taxon or product changes, so should we also run it each time a product changes? What we do in the catalog promotion plugin is to check |
Beta Was this translation helpful? Give feedback.
-
another three cases
|
Beta Was this translation helpful? Give feedback.
-
Thank you all very much for your feedback. We are currently considering event-driven architecture to apply catalog promotions, which will be based on Symfony messenger with doctrine transport layer in the standard implementation. We believe that this kind of approach will be the most flexible for our community to replace/extend/change. Let me explain how it could work:
Let's break it down into few problems as we did in the previous example: Storing catalog promotion configurationA new entity with all information about rules & actions that will take on the product catalog.
Triggering change on the product catalogThe default implementation will be based on delayed messages (This can also be an effortless cron job that will run every 10 minutes. Delayed messages will reduce the number of triggers to check if now is the time to apply promotion). During the creation of the catalog promotion, we will delay a message. In this case, it will be 24h. Start of the promo: End of the promo: ... -> here will be a place to implement messaging optimization algorithms. Like for example, in the case of big catalogs, some chunking mechanism. Regarding customer groups, it is a different type of problem. I am going to open a new discussion about this topic soon, so stay tuned. |
Beta Was this translation helpful? Give feedback.
-
Hi, @Arminek Just to clarify your idea. Do you want to force the usage of a doctrine transport to use a database table to hold delayed messages and then have a consumer reading from that table/queue? |
Beta Was this translation helpful? Give feedback.
-
@loevgaard We have started the first sprint about catalog promotions 🎉 |
Beta Was this translation helpful? Give feedback.
-
🖖 Hello, We have finished two sprints so far 🎉 . Features that we have covered:
Our next goals:
If you want to help us deliver the best quality you can contribute by testing what we did so far 💃 |
Beta Was this translation helpful? Give feedback.
-
🖖 Hello, Features that we have covered:
Our next goals:
Demo I would like to start testing it for big product catalogs. Do you have any SQL to share with a huge amount of products & variants (500k variants)? cc @loevgaard @stloyd @Prometee @Roshyo @vvasiloi |
Beta Was this translation helpful? Give feedback.
-
👋 Hello, Sylius community,
In the core team, we were discussing how to tackle catalog promotions. I would like to share our perspective on this topic with you, but before we jump into the proposition, let’s build a shared understanding of the problem.
Here is the story:
As a store owner, I want to make a discount for all products within a taxon by 50% starting 2021-03-21 and ending 2021-12-12
Okay, so let’s break down this case into few problems and possible solutions
This example story is straightforward, and of course, there are more complex cases, but let’s focus on this.
We would be very grateful if you could share any thoughts about this topic. Cheers!
Relates to:
Beta Was this translation helpful? Give feedback.
All reactions