Can discount codes override line-item promo scripts?

Hi. I have line-item promo script (shopify plus line-item script) with bulk discounts. But also have b2b customers with discounts codes.

It is possible to change the script so that if the user enters a discount code on the checkout page, the code will work. and the action of the script was canceled?
Can I set the value of the discount code in the script at which the script is not executed?
Thank you. Hope for help.

Hi @IvGordiichuk

I think you just need to add the condition before execution

if  Input.cart.discount_code == nil 
    //line script run
end
1 Like

Hi @Kani
Super. This is what was needed. I modified a little

unless Input.cart.discount_code && Input.cart.discount_code.code == 'MASTERCODE'
// script running...
end
if  Input.cart.discount_code == nil 
    //line script run
end
1 Like