2

Is there a way to set a discount in Commerce 2 that applies when, for example, three various products are in the cart?

Use case; Say you have a blue shirt, a black pant and a red cardigan, in the cart, and you wish to treat those as a kit. When all three are in the cart (either specific color variant, or simply a product), subtract $20 (or a percentage) from the total.

Edit; It would seem that adjusters is the way to go. Can someone shed some light on where those go, and how one would go about it when checking for multiple products against each other? Is the best way to create a module? Is there no admin UI whatsoever for adjustments? Is there a way to build adjustments with twig? Sorry, that's a lot of questions in one topic.

1 Answer 1

1

Indeed, the way to go is setting up a module or plugin for this sort of thing. While I did get that working in practice, I still have questions regarding how one can loop through and compare using the Craft CMS 3 Commerce 2 APIs to actually apply the discount based on custom fields on the variants. That will be a separate question entirely.

If you stumble upon this issue, the starting point I used was this; https://github.com/oof-bar/commerce-example-adjuster

Here's a link to the new question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.