Remove applied discounts for certain payment options using Scripts.

tomallan
Visitor
1 0 0

We have added a manual payment option to our checkout. When a user chooses this payment option we need any discounts that have been applied to the order through the checkout pricess to be removed or disabled.

Ideally, it would also display a note saying that discounts are not allowed for this option.

 

The trouble we see is that the Input.payment_gateways tag is only available on payment scripts (not line item scripts). 

 

Any ideas on how to tackle this one?

Reply 1 (1)

shuleGoing
Shopify Partner
32 1 5

Hi 👋

To do this I recommend using a Shopify Function and also a checkout extension to display the note. Access to checkout.liquid and Shopify scripts are being depreciated in 2024. 

If you need help with this please contact me shule@firstlight.dev 

Thanks 

Shule 

First Light - Shopify development agency
Specialists in Shopify custom app development and integrations
shule@firstlight.dev