This is a feature request to add a "cartLine" type target to the Discount Function API. Currently, we can only target `productVariant`. This is problematic when a given variant exists on multiple lines, such as when using selling plans or custom line attributes, but your discount should only apply to certain qualifying lines.
For example, if you have a 10% on all subscriptions and you're applying that through Discount Functions, if a customer adds a variant with a selling plan to their cart as well as the same variant without a selling plan, we currently have no way to apply the discount to just the line with the selling plan.
Yes, the customer does currently still get their intended discount. However, the UX is confusing. For example:
Note how the subscription discount is not being applied to the actual line with the selling plan.
Thanks for describing this use case - I can totally see how having a "cartLine" type target in the Discount Function API would be helpful in situations where a variant exists on multiple lines. The situation where a variant has a selling plan and the same variant without a selling plan in the cart is a good example of this.
Currently, our API only supports productVariant as a target, which, as you pointed out, could lead to confusion in the UI when the discount isn't applied to the intended line. I'll forward your feedback to our product team!