# Force PayPal Checkout Only with Divi & WooCommerce: A Beginner’s Guide
Want to offer only PayPal as a payment option on your Divi WooCommerce store? This guide will show you how, even if you’re a complete beginner. We’ll cover the why, the how, and even troubleshoot potential issues.
Why Force PayPal Checkout?
There are several reasons you might want to restrict your WooCommerce store to only accept PayPal payments:
- Simplified Checkout: A streamlined checkout process can lead to increased conversions. Fewer payment options mean less confusion for your customers.
- International Sales: PayPal is widely accepted globally, making it ideal for reaching a broader audience.
- Specific Business Needs: Maybe you have a specific reason for only accepting PayPal, such as managing international transactions or handling subscriptions more easily.
- Security Concerns: You might feel more secure managing payments through a single, trusted gateway like PayPal.
Method 1: Using a WooCommerce Plugin (Easiest Method)
The easiest way to force PayPal checkout in Divi WooCommerce is using a dedicated plugin. Several plugins offer this functionality. Search for “WooCommerce PayPal only” in your WordPress plugin directory. Look for highly-rated plugins with good reviews and frequent updates.
Example: Let’s imagine you find a plugin called “WooCommerce PayPal Checkout Only”. You would install and activate it as you would any other WordPress plugin. The plugin usually has simple settings to enable this functionality. This usually involves checking a box or selecting an option within the plugin’s settings page. No coding required!
Method 2: Using a Custom Code Snippet (For Advanced Users)
If you’re comfortable with code, you can use a custom code snippet. Caution: Modifying core code can break your site if not done correctly, so always back up your website before making any changes.
This method involves adding a code snippet to your theme’s `functions.php` file or a custom plugin. This will remove all other payment gateways except PayPal.
Here’s an example code snippet:
add_filter( 'woocommerce_available_payment_gateways', 'wc_allow_only_paypal' ); function wc_allow_only_paypal( $available_gateways ) { unset( $available_gateways['bacs'] ); //Remove Bacs unset( $available_gateways['cheque'] ); //Remove Cheque //Remove any other payment gateways you don't want here... return $available_gateways; }
This code removes BACs and Check payment gateways. You need to remove or comment out the lines for any payment gateways you want to keep . For instance, if you want to keep Stripe, you’d leave the line referring to Stripe.
Important Considerations:
- Identify your gateway slugs: Each payment gateway has a unique slug. You need to find the correct slugs for the gateways you want to disable. Check out this post: How To Uncheck The Shipping Address Option In Woocommerce You can find these in your WooCommerce settings under “Payments”.
- Testing: After adding the code, thoroughly test your checkout process to ensure it’s working correctly.
- Support: Using custom code often means you’re responsible for troubleshooting any issues.
Choosing the Right Method
For most users, using a dedicated WooCommerce plugin is the recommended approach. It’s simpler, safer, and requires no coding knowledge. Only use the Explore this article on How To Get Rid Of Woocommerce Bread Crumb custom code method if you are comfortable working with PHP and understand the potential risks involved.
Troubleshooting
- Payment Gateway Still Showing: Double-check your plugin settings or code snippet. Ensure you’ve correctly identified and removed the unwanted payment gateways.
- Checkout Errors: After making code changes, always clear your browser’s cache and test your checkout.
- Website Broken: If you accidentally break your website, restore from your backup.
By following these steps, you can successfully configure your Divi WooCommerce store to accept only PayPal payments. Remember to choose the method that best suits your technical skills and always prioritize backing up your website before making any significant changes.