Auto Apply discount when go to checkout page

hi team,

We want when we get to the checkout page. The discount will be automatically applied to an item product.

Note: We will not create discount in Shopify admin. We need to add discount automatically by script
Is there any API or scriptTag support for this?

Thanks

1 Like

@AlexBoy

You can try like this.


I hope this will help you,

Thank you.

It’s don’t work. Don’t find element “qty-break-wrapper”

Can help me check it ?

@AlexBoy

Why you are using same at it is?

It’s just for an example, you can build your own logic.

You are a developer, or if you are not then hire a developer.

thank for support,

The quantity change feature works fine.

Where I don’t change quantity and click the “Add to cart” button it doesn’t work. Discount is not added