Disable WooCommerce payment gateways is fairly straight forward once you know what the name of the gateway is. The following code will disable paypal and stripe payment gateways on the WooCommerce checkout page when the cart amount is greater than $1000. You can adjust the code to disable payment gateways based on certain products that […]
Tag: WooCommerce
WooCommerce BCC Completed Orders Email
Adding an audit trail to WooCommerce completed orders emails is a fairly easy task. We can achieve this by employing the filter woocommerce_email_headers and adding in a check for the object name customer_completed_order. ** This will work for WooCommerce version less than or equal to 2.2 **
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/** * BCC Email for orders completed for WooCommerce version 2.2 and below */ add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2); function mycustom_headers_filter_function( $headers, $object ) { if ($object == 'customer_completed_order') { $headers .= 'BCC: Sales <contact@eversionsystems.com>' . "\r\n"; } return $headers; } |
** For WooCommerce version 2.3 and above […]
WooCommerce Duplicate Billing to Shipping Address For Virtual Products
With WooCommerce if a customer orders a virtual product there is no shipping address displayed on the checkout page. This makes sense as there is no physical item being posted to your customer. However, a few of my clients like to have the WooCommerce billing address match the shipping address. Subsequently, I wrote this piece […]
Override WooCommerce Template Within Plugin
You might want to override a WooCommerce core template file in your plugin rather than in the theme directory to future proof theme switching. WooCommerce searches the following locations in this order until a match is found. Let’s alter this slightly so that it searches out plugin folder in order to override the WooCommerce template. […]
Copy billing to shipping address in WooCommerce
There is no function in WordPress to copy billing to shipping address fields that WooCommerce adds to user profiles. This is quite a tedious task if you are manually creating users via the WordPress dashboard. This article will show you how to use jQuery with a bit of PHP in WordPress to copy the billing […]