Solved

Can discount codes override line-item promo scripts?

IvGordiichuk
Shopify Partner
37 1 9

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.

Accepted Solution (1)

Kani
Shopify Partner
468 125 225

This is an accepted solution.

Hi @IvGordiichuk 

I think you just need to add the condition before execution

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

 

Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂

View solution in original post

Replies 2 (2)

Kani
Shopify Partner
468 125 225

This is an accepted solution.

Hi @IvGordiichuk 

I think you just need to add the condition before execution

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

 

Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂
IvGordiichuk
Shopify Partner
37 1 9

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

 

 


@Kani wrote:

Hi @IvGordiichuk 

I think you just need to add the condition before execution

 

 

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