- ๐น๐ทTurkey rgnyldz
Patch seems to apply without any issue bu nothing happens when I click on "Only with the selected promotions" or "Any promotion except the selected promotions"
I'm on drupal 10.0.1, commerce 2.32 and php8.1
- ๐น๐ทTurkey rgnyldz
My mistake, I did not run db update and cleared cache.
- ๐น๐ทTurkey rgnyldz
I also have an edge case for you :)
I created a content type called Campaigns so the admins can create a page containing the promotion information and display it on a page with a reference field to promotions. So they have to only work on one page for all the info like promotion itself and images, descriptions etc.
But inside the node edit page the radio buttons inside the inline entity form(simple) do not work. I presume that the patch is specific for the promotion edit page ?
- ๐ณ๐ดNorway zaporylie
It seems to me like this patch won't work with coupons as the coupon validation constraint calls Promotion::applies() and that happens after the promotion preprocess removes all the promotion adjustments and before the processor adds them back.
Disclaimer - I didn't test that theory but working on something similar now so wanted to chime in.
- ๐ง๐ชBelgium bceyssens Genk ๐ง๐ช
patch #20 seems to work for us with latest 2.x dev version.
- ๐ซ๐ทFrance nicolas bouteille
Hello,
We have the same need than what was described on #9
For Black Friday, we want to offer -50% on all products, but also -70% on some categories.
Our clients need to be able to buy a product at -50% and another at -70% in the same cart / order.
It looks like as described in #9, in Commerce right now, when a promotion in incompatible with another one, it means they cannot be used in the same cart / order at all, even though they don't affect the same product. Which I think is too bad :/
I was actually surprised to discover this is the behavior so far.
Since Lisa's idea has been posted 6 years ago, then reposted on #9 4 years ago, I can only imagine this requires a lot of work and will not be available anytime soonโฆ but can I suggest that this idea be at least mentioned in the description / roadmap of this issue?Also, in the mean time, could you advise me on how you would implement my current need?
I was thinking about adding a custom plugin to be able to exclude specific products or taxonomies.
That way, I could create -50% on all products except one category, and another promo -70% on this specific category. Marking both promo compatible so that they can be both used at the same time but making sure on my end that they cannot affect one same product.That makes me think that somebody has probably already created this kind of excluding plugin?
Thanks for your help.
Nicolas
- ๐ซ๐ทFrance nicolas bouteille
Ok just some follow up, here's how I managed to create a new condition to exclude some products (I will do the same for categories)
I just created a new plugin OrderItemExcludeProduct that extends OrderItemProduct and only overrides the evaluate() function to negate it:public function evaluate(EntityInterface $entity) { return ! parent::evaluate($entity); }
I also took care of displaying a huge warning to make sure the person creating the promotion also adds another condition such as Specific product category AND selects 'Condition operator' : 'All conditions must pass'. If not, the consequence will be : the promotion will be applied on any product not excluded here, even if it does not match the other condition(s)...
By the way, the default value for Condition operator is 'Only one condition must pass' but shouldn't it say 'At least one condition must pass'?
I just tested this and it does not break if I have more than one condition passing... - ๐ซ๐ทFrance flocondetoile Lyon
For those who need the patch without the hook_update_N, as me who run this patch since 4 years (I implements the update_N in a custom module to not break other futur hook_update_N of the module), here it is.
- ๐ฎ๐ฑIsrael jsacksick
@flocondetoile: Can we get an MR? So we can see if the tests are passing/failing?
- Merge request !464Issue #3010862 by kristiaanvandeneynde, flocondetoile, andriy khomych,... โ (Open) created by jsacksick
- ๐ฎ๐ฑIsrael jsacksick
I'm curious, this patch was never RTBCED, @flocondetoile: Have you been encountering any issue in the projects where this has been applied?
I also think there are some use cases that won't work properly (due to how coupons are applied for example). - ๐ซ๐ทFrance flocondetoile Lyon
I ran this patch since 4 years without issues. But I didn't have use case with coupons. I used it to make promotions incompatibles with others, without any coupons behavior associated with them.
- ๐บ๐ธUnited States derekw
I did have trouble using this patch when a coupon was applied and both were targeted at order items. When the coupon was applied no other discounts were applied even if they were applicable. Fortunately the coupon use was a rare case for us. Otherwise the patch worked.
Instead of using the Compatibility with other promotions feature I added custom conditions to evaluate order item product variation attributes for determining promotion applicability, and that was adequate to deconflict promotions.