Is it possible to remove PayPal on certain product

Highlighted
New Member
3 0 0

Hi, hope you are well. Our site has received an email asking us to remove certain products as the violate PayPals terms of service (CBD), we generate a high number of sales through these products so completely removing is not really an option.

I know it's possible to remove the PayPal button from selected product pages, but this will potentially mean that customers would still be able to purchase when adding other items to their basket. Is there a way that if a product is added to the basket the option for PayPal is then removed.

Thanks 

0 Likes
Highlighted
Shopify Partner
3 0 0

Yes, but only in the Shopify Plus plan.

You can have a script that hides the PayPal option when it finds a CBD related product (using tags, or any other method) in your cart.

0 Likes
Highlighted
New Member
3 0 0

Hi Sprites, thanks for your reply. Yes we have a shopify plus account. I have come across the below script. Firstly is this what I would need and secondly, we have multiple CBD products, would I need to change the 1st line of the code and then include the product and repeat this process for each product or am I able to put a collection within there so anything within that is included? Thanks for you help 

 

has_no_paypal_tag = Input.cart.line_items.any? { |line_item| line_item.variant.product.tags.include?('no-paypal') }
  
 if has_no_paypal_tag
 Output.payment_gateways = Input.payment_gateways.delete_if { |payment_gateway| payment_gateway.name.include?("PayPal") }
 else
 Output.payment_gateways = Input.payment_gateways
 end
0 Likes
Highlighted
Shopify Partner
3 0 0

I found a solution that may work for you here.

Obviously you need to work with SKUs and change the gateway provider.

I hope it works.

0 Likes
Highlighted
New Member
3 0 0

This looks just the thing, thank you so much. I will have a play about tomorrow morning. 

0 Likes