App reviews, troubleshooting, and recommendations
I want to make an app with payment customization extension to hide a certain payment method (COD) for some customers.
The customers are those who has an order with HIDE tag in last 30 days. How to achieve this.
Please help me on this @garyrgilbert
Hi @bipu,
Sorry for the late reply.
first I would suggest following along with the payment customization tutorial that shopify has.
Secondly I would seriously consider redesigning how you want to achieve this, instead of looking at all the orders the customer has and if any one of them in the last 30 days has a hide tag instead tag the customer, or even better create a metafield "hideCOD" and make it a date field. And instead of tagging the order with hide, you update the metafield of the customer with the order date.
then in the run input graphql you ask for that meta field as well as query the shop{localTime{date}} field and compare that to the metafield date taking your 30 day span into consideration, and hide the COD payment method if necessary.
You will not be able to use the function to query the customers orders in the last 30 days. This type of operation needs to be fast, thats why I said to put it all in metafield of the customer.
I hope this helps,
Cheers
Gary
Learn what's possible with customizing Shopify Checkout beyond what's available out of...
By Shopify Feb 19, 20252m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025