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
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 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
/* Add to cart button text */ | |
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text'); | |
function woo_custom_cart_button_text() { | |
return __('Add to Cart', 'woocommerce'); | |
} |
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
<?php | |
/** | |
* Single product quantity inputs | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 2.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
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 woocommerce_result_count() {} |
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
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
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
/*========================================= | |
ACF Repeater | |
======================================== */ | |
add_action( 'woo_post_inside_after', 're_acf_repeater', 10); // hook is the first part | |
function re_acf_repeater () { ?> | |
<?php if(get_field('field_name')): ?> | |
<ul> | |
<?php while(has_sub_field('field_name')) { ?> |
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( 'woocommerce_get_price_html', 'warnies_price_html', 100, 2 ); | |
function warnies_price_html( $price, $product ){ | |
return '<div class="price">' . $price . '</div>'; | |
} |