Skip to content

Instantly share code, notes, and snippets.

@procarrera
Created September 16, 2021 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save procarrera/406ed778e91d39b1489dd29bcc42bb02 to your computer and use it in GitHub Desktop.
Save procarrera/406ed778e91d39b1489dd29bcc42bb02 to your computer and use it in GitHub Desktop.
SHOPIFY : Hide a specific Gateway Method for customers not tagged with a given tag
customer = Input.cart.customer
puts(customer)
if customer
if customer.tags.include? 'TEST'
Output.payment_gateways = Input.payment_gateways
else
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway|
payment_gateway.name == 'Pay on pickup'
end
end
else
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway|
payment_gateway.name == 'Pay on pickup'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment