Using Magento 2.4.
I need some help in tackling a task.
In a store developed with Magento2 I need to create/extend the validation for coupon codes. This particular store relies heavily on coupon codes and some of them gives the customer 100% off on their orders. But, when this store integrates their sales with an external tool, the sales that are 100% off can't be integrated, because this tool doesn't accept the value 0 for sales' imports.
The lead, along with the stakeholders, decided to do the following:
- Allow the creation of 100% off coupons and allow customers to use them, BUT, when they do use them (cart or checkout), process the coupon in a custom validation that will give them a message that says "Coupon AABBCC can only be used in sales that are over $$value", where "$$value" is the sale's value plus one.
I've been trying to run this validation for a while now, but, since I am new to Magento, I am having trouble in tackling this issue.
I am trying to extend salesrules validations' in a custom module, but, if I remember it correctly, the validation is triggered in js, and I am not succeeding in doing it.
If there are any github modules that may help me in this, please, name them for me. Or if any of you could point me in the right direction, it would be appreciated.
Thanks in advance.