This is a cool function you can apply to any payment gateways for any order threshold. for example, you may want to disable bank transfers if orders are below $10, or disable PayPal payments if orders are above a certain cart total. Here’s what I did. Continue reading WooCommerce: How to Disable PayPal on Orders Above $100
WooCommerce database stores the number of products sold.
Therefore, you may want to show such number on the product page, close to the Add To Cart button. As we’ve seen in my book Ecommerce and Beyond, showing the number of sales for each product can increase your sales conversion rate.
All you need is pasting the following code in your functions.php to show it in the product summary. Continue reading WooCommerce: Show Number Of Products Sold on Product Page
You may want to disable payment gateways depending on the user role or user capability. For example, you may want to disable PayPal for “user role: shop_manager” or enable a specific gateway for “user role: customer”. All you need is pasting the following code in your functions.php Continue reading WooCommerce: Disable Payment Gateway for Specific User Role
If Free Shipping is available, you possibly don’t want to show the other paid shipping options. WooCommerce shows by default all shipping rates that match a given shipping zone, so it’s not possible to achieve this from the settings alone.
You need PHP for that. In this example, we will disable all shipping methods but “Free Shipping” so that free shipping remains the only possible choice. And here’s the code to add to your functions.php 🙂Continue reading WooCommerce: Hide Shipping Rates if Free Shipping Available
You might want to disable PayPal for non-local customers or enable a specific gateway for only one country… Either way, this is a very common requirement for all of those who trade internationally.
Here’s a simple snippet you can further customize to achieve your objective. Simply pick the payment gateway “slug” you want to disable/enable (“paypal”, “authorize”, “stripe”, etc.) and the country code (US, ES, IE, etc.) and then apply your conditional rules in the plugin below.Continue reading WooCommerce: Disable Payment Gateway for a Specific Country