Limit WooCommerce Payment Gateways Based on country

In some cases you would like to limit the payment gateways your WooCommerce store offers based on the customer’s billing country. The following code snippet uses the woocommerce_available_payment_gateways filter to accomplish this. First, you will need to find and copy the payment gateway stub by going to: WP-Admin > WooCommerce > Settings > Payments > …

Disable WP Plugin using PhpMyAdmin

Sometimes there are plugin conflicts that can case fatal errors on your site and/or prevent users from logging into wp-admin. This happened to me recently where a bug in a reCaptcha login plugin was preventing WC Shop managers from logging in. This bug was also preventing the admin, me, from authenticating as well. In cases …

Exclude Product Tag from Coupons

This code snippet excludes product with a specific WooCommerce product_tag from being included in any coupon discount. Simply replace “kits” with the slug of the product_tag you want to exclude. has_term() also accepts an array in the first argument. Update: once again, variable products got the best of me. In WooCommerce, the product_tag is associated …

Change Number of Search Results for Specific User in Woocommerce

Normally Woocommerce pulls the number of results from the standard WordPress settings, usually set to 20-30 for most installs. For many environments it is helpful to keep this number relatively low for performance reasons. However, for specific logged in users, it can be helpful to set a higher default. My client wanted his default set …

Format Billing Phone Number on Woocommerce

By default, Woocommerce does not format the billing phone number entered into the checkout field. However the user formats the number, that is how it gets entered into the database and how it is displayed throughout the Woocommerce Admin. Unformatted phone numbers are difficult to read and can also create difficulties when trying to search …

Display PayPal Fee on Woocommerce Order

This code snippet works with the Paypal Standard Woocommerce Payment Gateway. It adds the PayPal fee and payout information to the WooCommerce Edit Order Screen. If you are using WooCommerce PayPal Checkout Payment Gateway, this snippet is not needed. I am not sure about compatibility or necessity for any of the other many PayPal gateways.