How can I allow coupon codes if a specific tag is found in the user agent?

I have some coupon codes, and I want them to work only when a custom tag exists in the user agent. When users enter these codes in the discount field on the checkout page, the validation should ensure the tag is present in the user agent. This checkout process should be available for both types of customers: logged-in and non-logged-in users. I have a Shopify Plus plan in my Shopify store, and I want this to be implemented on the checkout page not on cart page.

Can anyone assist with this?

Hi @Arvind_Kumar

  1. It is necessary to create segments for the customer.


Enter the tag you want to use

thanks @kyle_liu for your response. This solution works for existing customers, but I also need to implement this feature for new customers.