Create rule for discount coupon on line item

Hi everyone, how are you?

I have a few questions: Is it possible to create a rule for a discount coupon on a line item/product?

The idea is that there will be several coupons, and each coupon will have a specific rule. I wanted to validate if it’s possible to create one, and also how it would work within a business and payment cycle within Hub (I don’t know if that last part is confusing).

An example (not the real names):

Coupon 1 (UNIMED20): Discount applied to customers X that grants a discount on the first three installments of the purchase.

Coupon 2 (HUBERT90): Discount applied to the first installment only.

How would we create this rule with these examples? Is it through automation?

Also, if possible: Connect this result to another property to render it in a custom Hub quote template, the one created by HubL.

Hey @ViniBernardo,
you could try some workflows with “if/then” branches or custom coded actions for this.

If this shouldn’t give you the desired result, you could try creating a custom module with something like

{% if item.discount == "unimed20" %}
 {% set price = item.price * "0.2%" %}
{% elif item.discount == "hubert90" %}
 {% set price = item.price * "0.9%" %}
{% endif %}
...
<span class="priceOutput">{{ price }}</span>

^ just example code to display the idea; most likely won’t work

best,

Anton

Hi Anton

So, is there anything in this criterion that meets the scenario of:

A line item has a 5% discount for the first 3 months, after which it will no longer exist. And so the line item returns to its original price.

Can this formula be applied?
I thank you in advance for your support, and I apologize as it is a very complicated topic LOL