Hide Payment Methods at Checkout
Shopify Plus merchants can stop Clearpay being offered at the checkout for selected products.
Note
This feature is for merchants with a Shopify Plus integration only.
Use this feature to hide the Clearpay and/or Cash App Pay payment methods at checkout for specific products that you, the merchant, choose.
Note
You cannot use Shopify Scripts unless you already have the Script Editor installed. Shopify will not support Shopify Scripts after August 28th 2025. In future you can use Shopify Functions apps to customise your checkout.
To prevent your customers using Clearpay to pay for a specific product, tag that product as no-clearpay.
To implement this feature, do the following:
- Download the Script Editor Shopify App.
- Add no-clearpay Shopify tags to each product that is not available to buy with Clearpay.
Create and Edit Script
Create the Script in the Editor
Once you have added the tags in step 2 above, you need to create the script. Do the following::
-
Open the Script Editor Shopify App if it is not already open.
-
Click Create Script.
-
Select the Payment gateways tab, then click the Hide payment gateway radio button. See picture below:
Edit the Script in the Editor
Use the Script Editor Shopify App to edit the following:
-
Update the Title field.
-
Set Channels radio button to Online Store only.
-
Copy and paste the following code snippet into the Ruby source code section:
no_clearpay = Input.cart.line_items.any? { |line_item| line_item.variant.product.tags.include?('no-clearpay') }
Output.payment_gateways = Input.payment_gateways
if no_clearpay
Output.payment_gateways = Output.payment_gateways.delete_if { |payment_gateway| payment_gateway.name.include?("Clearpay") }
end
Note
You may need to edit this code snippet depending on your specific site setup and/or the product tags you decide to use for this purpose. This is a Shopify feature, so we (Clearpay) cannot give specific instructions for all cases and setups.
-
Click the Save and publish button.
-
Test the conditional Clearpay gateway visibility on selected products on your site's checkout page.
Warning
The script and tags described on this page do not apply to draft orders. These draft orders are created when you send the customer an invoice by email. Clearpay appears as a payment method on these invoices.
Updated about 2 months ago