craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[4.x]: Applying Multiple Discount Vouchers Simultaneously #3539

Closed ax2000 closed 1 month ago

ax2000 commented 3 months ago

What happened?

Description

I have a question regarding the functionality of discount vouchers.

Currently, as I understand it, Craft Commerce allows only one discount voucher to be applied per order. This behavior seems consistent in both Craft Commerce 4 and Craft Commerce 5. However, my client has a requirement where multiple discount vouchers should be applicable to a single order simultaneously (E.g. Percentage of Products and Free Shipping)

My questions are:

I have considered creating a custom module to handle multiple discounts, but I wanted to check if there are any built-in solutions or upcoming features that might address this need before proceeding with a custom implementation.

I am currently using Craft CMS with Craft Commerce (version details below). Any guidance or recommendations you can provide would be greatly appreciated.

Cheers, Alby

Craft CMS version

Craft Pro 4.9.7

Craft Commerce version

Craft Commerce 4.6.2

PHP version

8.2.18

Operating system and version

Linux 6.6.26-linuxkit

Database type and version

MariaDB 10.2.44

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

-

linear[bot] commented 3 months ago

PT-1810 [4.x]: Applying Multiple Discount Vouchers Simultaneously

nfourtythree commented 1 month ago

Hi @ax2000

Thank you for your question, as you rightly stated, currently, you cannot apply multiple coupon codes to a cart. We aren't looking to change that behaviour anytime soon. Happy for you to submit it as a feature request.

In terms of what you could do now:

As you mentioned you could do this via custom code in a module to automatically add more discount adjustments.

You could also add a custom condition rule to the "Match Order" condition in discounts that would look for the coupon code on the order. The reason we don't do this natively is to avoid confusion with the actual coupon code matching and it would only be for matching (so no adding to totals or checking limits).

Hope this helps, thanks!