Hide Payment method or Gateway on specific Discount Coupon Code, referring given Help Manual

Hello,

I have one request, and need to know one thing.

On the basis of below Shopify official docs page, I just wanted to know can we Hide any specific Payment method or option or Gateway if a user (or customer) applies some specific Discount coupon code.

Say, If we create a Discount coupon with 10% OFF on All or selected products, with name DISC10OFF.
And if any user uses this Code during checkout, then any specific Payment method or option or Gateway should get Hidden.
Somewhat similar to below one, and as a reference –

https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/payment-gateway-scripts

PS:

  1. We actually want to Hide Cash-On-Delivery (COD) Payment Method (option or Gateway), once a Coupon code is applied. As, we want to offer Discount Only on Prepaid Orders (Payment via Card, Netbanking, other online sources)

Another reference link for COD payment option (just in case)
https://help.shopify.com/en/manual/payments/cash-on-delivery

  1. I know this can be done. And I have seen this on someone’s else Store using one of the Popular themes (from Themeforest marketplace)

Can someone from Shopify Moderator team (or core tech team) please suggest the Updated code, by referring to the above official Shopify Docs page.
Also, can this code also be Added on the above Help Manual page, as per the request and requirement, I have posted above. The same way, few other custom scripts have already been added.

Please suggest

Regards

1 Like

Looking for the same solution on my store as well. I am using a COD form in which I allow customers automatic discounts on prepaid orders. But I don’t want customers to use other coupon codes with it as well. I need to either disallow Prepaid when a coupon code is used or give a message that PREPAID and other discounts cannot be combined.

Hi,

It is possible to do this using our free app Payment Customizations: PayMix.

You can setup a rule in PayMix to “Show specific payment methods and hide others” when the cart contains discount.

Here is a small video to see how the end effect would look like:

We also have in-app live chat support available inside the app to help you with any queries that you might have.