- πΉπ·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...