This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Changes the redirect URL for the Return To Shop button in the cart. | |
* | |
* @return string | |
*/ | |
function wc_empty_cart_redirect_url() { | |
return 'http://mywebsite.com/sample-page/'; | |
} | |
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_product_get_tax_class', 'big_apple_get_tax_class', 1, 2 ); | |
function big_apple_get_tax_class( $tax_class, $product ) { | |
if ( WC()->cart->subtotal > 150 // 150 eur = 135 gbp, until a live rate is available | |
&& WC()->customer->get_billing_country() === 'GB' // only change the tax class for customers from GB. _billing_ can be changed to _shipping_ as well. | |
&& ! preg_match( 'BT', strtoupper( WC()->customer->get_billing_postcode() ) ) // but only those outside of Northern Ireland | |
) { | |
$tax_class = 'Zero Rate'; | |
} | |
return $tax_class; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('profile_update', 'wc_fue_update_customers_table_user_profile_update', 10, 2); | |
function wc_fue_update_customers_table_user_profile_update( $user_id, $old_user_data ) { | |
// step 1 - get user from user id and email. | |
$user = get_userdata($user_id); | |
if ( !$user ) { | |
return; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Extend WooCommerce Subscription Intervals | |
* Description: Add a "every 25" billing interval to WooCommerce Subscriptions | |
* Author: Brent Shepherd | |
* Author URI: http://brent.io | |
* Version: 1.0 | |
* License: GPL v2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#woocommerce_eu_vat_number { | |
position: absolute; | |
top: 230px; | |
width: 100%; | |
} | |
#billing_country_field { | |
margin-top: 6em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.woocommerce-message a.button.wc-forward:hover { | |
color: #222 !important; /* change this color code! */ | |
} | |
.woocommerce input.button, .woocommerce input.button:hover { | |
color: #333 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make Pre-Publish Post Checklist work with Custom Post Types | |
* Add to your functions.php file | |
*/ | |
function my_add_meta_boxes() { | |
add_meta_box( | |
'pc-meta-box', | |
'Pre-Publish Post Checklist', | |
'pc_create_meta_box_callback', | |
'YOUR_CPT', /* Change this your Custom Post Type ID */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('woocommerce_email_recipient_backorder', 'wc_change_admin_backorder_email_recipient', 1, 2); | |
function wc_change_admin_backorder_email_recipient( $recipient, $order ) { | |
global $woocommerce; | |
$recipient = "[email protected]"; // change this value to the appropriate email! | |
return $recipient; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_get_price_html', 'custom_price_suffix', 100, 2 ); | |
function custom_price_suffix( $price, $product ){ | |
$price = $price . ' +VAT'; | |
return apply_filters( 'woocommerce_get_price', $price ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a 3% surcharge to your cart / checkout | |
* change the $percentage to set the surcharge to a value to suit | |
*/ | |
add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' ); | |
function woocommerce_custom_surcharge() { | |
global $woocommerce; | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) |
NewerOlder