This file contains hidden or 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
function wpse_77783_woo_bacs_ibn($translation, $text, $domain) { | |
if ($domain == 'woocommerce') { | |
switch ($text) { | |
case 'Sort Code': | |
$translation = 'BSB'; | |
break; | |
} | |
} |
This file contains hidden or 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
This isn't code, just a tip that will hopefully get picked up by search engines for anyone that needs it (me when I have this problem next). | |
domain.com/cart/?add-to-cart=15998&credit_called[15998]=44 | |
Where 15998 is the product ID |
This file contains hidden or 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
function wc_translate_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Related Products' : | |
$translated_text = __( 'Like this? Try these:', 'woocommerce' ); | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'wc_translate_strings', 20, 3 ); |
This file contains hidden or 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
/* ===================================================== | |
Custom profile field | |
===================================================== */ | |
function modify_contact_methods($profile_fields) { | |
// Add new fields | |
$profile_fields['company_name'] = 'Company Name'; | |
// Remove old fields | |
unset($profile_fields['aim']); |
This file contains hidden or 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 _subscription_start_date back to the viewable order meta data */ | |
add_filter( 'woocommerce_hidden_order_itemmeta', 'theme_hide_order_itemmeta' ); | |
function theme_hide_order_itemmeta( $hidden_meta_keys ) { | |
if ( ! defined( 'WCS_DEBUG' ) || true !== WCS_DEBUG ) { | |
if(($key = array_search('_subscription_start_date', $hidden_meta_keys)) !== false) { | |
unset($hidden_meta_keys[$key]); | |
} | |
} | |
return $hidden_meta_keys; | |
} |
This file contains hidden or 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( 'soliloquy_output_before_caption', 're_soliloquy_link_caption_start', 10, 5 ); | |
function re_soliloquy_link_caption_start( $html, $id, $item, $data, $i ) { | |
$html .= '<a href="' . esc_url( $item['link'] ) . '">'; | |
return $html; | |
} | |
add_filter( 'soliloquy_output_after_caption', 're_soliloquy_link_caption_end', 10, 2 ); | |
function re_soliloquy_link_caption_end( $html ) { | |
$html .= '</a>'; | |
return $html; |
This file contains hidden or 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('woocommerce_after_checkout_validation', 'deny_pobox_postcode'); | |
function deny_pobox_postcode( $posted ) { | |
global $woocommerce; | |
// Put postcode, address 1 and address 2 into an array | |
$check_address = array(); | |
$check_address[] = isset( $posted['shipping_postcode'] ) ? $posted['shipping_postcode'] : $posted['billing_postcode']; | |
$check_address[] = isset( $posted['shipping_address_1'] ) ? $posted['shipping_address_1'] : $posted['billing_address_1']; | |
$check_address[] = isset( $posted['shipping_address_2'] ) ? $posted['shipping_address_2'] : $posted['billing_address_2']; |